diff options
Diffstat (limited to 'fs/ocfs2/super.c')
-rw-r--r-- | fs/ocfs2/super.c | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 7efb349fb9bd..a3f8871d21fd 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -777,6 +777,7 @@ static int ocfs2_sb_probe(struct super_block *sb, | |||
777 | } | 777 | } |
778 | di = (struct ocfs2_dinode *) (*bh)->b_data; | 778 | di = (struct ocfs2_dinode *) (*bh)->b_data; |
779 | memset(stats, 0, sizeof(struct ocfs2_blockcheck_stats)); | 779 | memset(stats, 0, sizeof(struct ocfs2_blockcheck_stats)); |
780 | spin_lock_init(&stats->b_lock); | ||
780 | status = ocfs2_verify_volume(di, *bh, blksize, stats); | 781 | status = ocfs2_verify_volume(di, *bh, blksize, stats); |
781 | if (status >= 0) | 782 | if (status >= 0) |
782 | goto bail; | 783 | goto bail; |
@@ -1182,7 +1183,7 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) | |||
1182 | wake_up(&osb->osb_mount_event); | 1183 | wake_up(&osb->osb_mount_event); |
1183 | 1184 | ||
1184 | /* Start this when the mount is almost sure of being successful */ | 1185 | /* Start this when the mount is almost sure of being successful */ |
1185 | ocfs2_orphan_scan_init(osb); | 1186 | ocfs2_orphan_scan_start(osb); |
1186 | 1187 | ||
1187 | mlog_exit(status); | 1188 | mlog_exit(status); |
1188 | return status; | 1189 | return status; |
@@ -1213,14 +1214,31 @@ static int ocfs2_get_sb(struct file_system_type *fs_type, | |||
1213 | mnt); | 1214 | mnt); |
1214 | } | 1215 | } |
1215 | 1216 | ||
1217 | static void ocfs2_kill_sb(struct super_block *sb) | ||
1218 | { | ||
1219 | struct ocfs2_super *osb = OCFS2_SB(sb); | ||
1220 | |||
1221 | /* Failed mount? */ | ||
1222 | if (!osb || atomic_read(&osb->vol_state) == VOLUME_DISABLED) | ||
1223 | goto out; | ||
1224 | |||
1225 | /* Prevent further queueing of inode drop events */ | ||
1226 | spin_lock(&dentry_list_lock); | ||
1227 | ocfs2_set_osb_flag(osb, OCFS2_OSB_DROP_DENTRY_LOCK_IMMED); | ||
1228 | spin_unlock(&dentry_list_lock); | ||
1229 | /* Wait for work to finish and/or remove it */ | ||
1230 | cancel_work_sync(&osb->dentry_lock_work); | ||
1231 | out: | ||
1232 | kill_block_super(sb); | ||
1233 | } | ||
1234 | |||
1216 | static struct file_system_type ocfs2_fs_type = { | 1235 | static struct file_system_type ocfs2_fs_type = { |
1217 | .owner = THIS_MODULE, | 1236 | .owner = THIS_MODULE, |
1218 | .name = "ocfs2", | 1237 | .name = "ocfs2", |
1219 | .get_sb = ocfs2_get_sb, /* is this called when we mount | 1238 | .get_sb = ocfs2_get_sb, /* is this called when we mount |
1220 | * the fs? */ | 1239 | * the fs? */ |
1221 | .kill_sb = kill_block_super, /* set to the generic one | 1240 | .kill_sb = ocfs2_kill_sb, |
1222 | * right now, but do we | 1241 | |
1223 | * need to change that? */ | ||
1224 | .fs_flags = FS_REQUIRES_DEV|FS_RENAME_DOES_D_MOVE, | 1242 | .fs_flags = FS_REQUIRES_DEV|FS_RENAME_DOES_D_MOVE, |
1225 | .next = NULL | 1243 | .next = NULL |
1226 | }; | 1244 | }; |
@@ -1819,6 +1837,12 @@ static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err) | |||
1819 | 1837 | ||
1820 | debugfs_remove(osb->osb_ctxt); | 1838 | debugfs_remove(osb->osb_ctxt); |
1821 | 1839 | ||
1840 | /* | ||
1841 | * Flush inode dropping work queue so that deletes are | ||
1842 | * performed while the filesystem is still working | ||
1843 | */ | ||
1844 | ocfs2_drop_all_dl_inodes(osb); | ||
1845 | |||
1822 | /* Orphan scan should be stopped as early as possible */ | 1846 | /* Orphan scan should be stopped as early as possible */ |
1823 | ocfs2_orphan_scan_stop(osb); | 1847 | ocfs2_orphan_scan_stop(osb); |
1824 | 1848 | ||
@@ -1981,6 +2005,8 @@ static int ocfs2_initialize_super(struct super_block *sb, | |||
1981 | snprintf(osb->dev_str, sizeof(osb->dev_str), "%u,%u", | 2005 | snprintf(osb->dev_str, sizeof(osb->dev_str), "%u,%u", |
1982 | MAJOR(osb->sb->s_dev), MINOR(osb->sb->s_dev)); | 2006 | MAJOR(osb->sb->s_dev), MINOR(osb->sb->s_dev)); |
1983 | 2007 | ||
2008 | ocfs2_orphan_scan_init(osb); | ||
2009 | |||
1984 | status = ocfs2_recovery_init(osb); | 2010 | status = ocfs2_recovery_init(osb); |
1985 | if (status) { | 2011 | if (status) { |
1986 | mlog(ML_ERROR, "Unable to initialize recovery state\n"); | 2012 | mlog(ML_ERROR, "Unable to initialize recovery state\n"); |