diff options
Diffstat (limited to 'fs/ocfs2/super.c')
-rw-r--r-- | fs/ocfs2/super.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 63af2e36d834..f2893878f8ad 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -1213,14 +1213,27 @@ static int ocfs2_get_sb(struct file_system_type *fs_type, | |||
1213 | mnt); | 1213 | mnt); |
1214 | } | 1214 | } |
1215 | 1215 | ||
1216 | static void ocfs2_kill_sb(struct super_block *sb) | ||
1217 | { | ||
1218 | struct ocfs2_super *osb = OCFS2_SB(sb); | ||
1219 | |||
1220 | /* Prevent further queueing of inode drop events */ | ||
1221 | spin_lock(&dentry_list_lock); | ||
1222 | ocfs2_set_osb_flag(osb, OCFS2_OSB_DROP_DENTRY_LOCK_IMMED); | ||
1223 | spin_unlock(&dentry_list_lock); | ||
1224 | /* Wait for work to finish and/or remove it */ | ||
1225 | cancel_work_sync(&osb->dentry_lock_work); | ||
1226 | |||
1227 | kill_block_super(sb); | ||
1228 | } | ||
1229 | |||
1216 | static struct file_system_type ocfs2_fs_type = { | 1230 | static struct file_system_type ocfs2_fs_type = { |
1217 | .owner = THIS_MODULE, | 1231 | .owner = THIS_MODULE, |
1218 | .name = "ocfs2", | 1232 | .name = "ocfs2", |
1219 | .get_sb = ocfs2_get_sb, /* is this called when we mount | 1233 | .get_sb = ocfs2_get_sb, /* is this called when we mount |
1220 | * the fs? */ | 1234 | * the fs? */ |
1221 | .kill_sb = kill_block_super, /* set to the generic one | 1235 | .kill_sb = ocfs2_kill_sb, |
1222 | * right now, but do we | 1236 | |
1223 | * need to change that? */ | ||
1224 | .fs_flags = FS_REQUIRES_DEV|FS_RENAME_DOES_D_MOVE, | 1237 | .fs_flags = FS_REQUIRES_DEV|FS_RENAME_DOES_D_MOVE, |
1225 | .next = NULL | 1238 | .next = NULL |
1226 | }; | 1239 | }; |
@@ -1819,6 +1832,12 @@ static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err) | |||
1819 | 1832 | ||
1820 | debugfs_remove(osb->osb_ctxt); | 1833 | debugfs_remove(osb->osb_ctxt); |
1821 | 1834 | ||
1835 | /* | ||
1836 | * Flush inode dropping work queue so that deletes are | ||
1837 | * performed while the filesystem is still working | ||
1838 | */ | ||
1839 | ocfs2_drop_all_dl_inodes(osb); | ||
1840 | |||
1822 | /* Orphan scan should be stopped as early as possible */ | 1841 | /* Orphan scan should be stopped as early as possible */ |
1823 | ocfs2_orphan_scan_stop(osb); | 1842 | ocfs2_orphan_scan_stop(osb); |
1824 | 1843 | ||