aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-05-01 01:59:42 -0400
committerTheodore Ts'o <tytso@mit.edu>2009-05-01 01:59:42 -0400
commita63c9eb2ce6f5028da90f282798232c4f398ceb8 (patch)
tree3b32193dfc80a3925f5ea5a6545765f5176a6f2d /fs/ext4
parent114e9fc90703bd6aac0229fb559e97caa6c49770 (diff)
ext4: ext4_mark_recovery_complete() doesn't need to use lock_super
The function ext4_mark_recovery_complete() is called from two call paths: either (a) while mounting the filesystem, in which case there's no danger of any other CPU calling write_super() until the mount is completed, and (b) while remounting the filesystem read-write, in which case the fs core has already locked the superblock. This also allows us to take out a very vile unlock_super()/lock_super() pair in ext4_remount(). Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/super.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index e3b35f26d5fe..45d0ada9bfce 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3219,13 +3219,11 @@ static void ext4_mark_recovery_complete(struct super_block *sb,
3219 if (jbd2_journal_flush(journal) < 0) 3219 if (jbd2_journal_flush(journal) < 0)
3220 goto out; 3220 goto out;
3221 3221
3222 lock_super(sb);
3223 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER) && 3222 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER) &&
3224 sb->s_flags & MS_RDONLY) { 3223 sb->s_flags & MS_RDONLY) {
3225 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); 3224 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
3226 ext4_commit_super(sb, 1); 3225 ext4_commit_super(sb, 1);
3227 } 3226 }
3228 unlock_super(sb);
3229 3227
3230out: 3228out:
3231 jbd2_journal_unlock_updates(journal); 3229 jbd2_journal_unlock_updates(journal);
@@ -3436,15 +3434,8 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
3436 (sbi->s_mount_state & EXT4_VALID_FS)) 3434 (sbi->s_mount_state & EXT4_VALID_FS))
3437 es->s_state = cpu_to_le16(sbi->s_mount_state); 3435 es->s_state = cpu_to_le16(sbi->s_mount_state);
3438 3436
3439 /* 3437 if (sbi->s_journal)
3440 * We have to unlock super so that we can wait for
3441 * transactions.
3442 */
3443 if (sbi->s_journal) {
3444 unlock_super(sb);
3445 ext4_mark_recovery_complete(sb, es); 3438 ext4_mark_recovery_complete(sb, es);
3446 lock_super(sb);
3447 }
3448 } else { 3439 } else {
3449 int ret; 3440 int ret;
3450 if ((ret = EXT4_HAS_RO_COMPAT_FEATURE(sb, 3441 if ((ret = EXT4_HAS_RO_COMPAT_FEATURE(sb,