diff options
author | Eric Sandeen <sandeen@redhat.com> | 2009-12-14 13:59:59 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2009-12-23 07:44:11 -0500 |
commit | 4854a5f0cbb1967fc7db3ea861d97afeea78b88b (patch) | |
tree | 092ac94277b2f3fc506f177a04f3e541e14b8aaa /fs/ext3 | |
parent | ed505ee454dbf133b1a4067d3ac0325d4261eda1 (diff) |
ext3: ext3_mark_recovery_complete() doesn't need to use lock_super
The function ext3_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
ext3_remount().
Port of ext4 commit a63c9eb2ce6f5028da90f282798232c4f398ceb8 by
Theodore Ts'o <tytso@mit.edu>.
CC: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext3')
-rw-r--r-- | fs/ext3/super.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 8ad566b845ae..806b8b780add 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -2396,13 +2396,11 @@ static void ext3_mark_recovery_complete(struct super_block * sb, | |||
2396 | if (journal_flush(journal) < 0) | 2396 | if (journal_flush(journal) < 0) |
2397 | goto out; | 2397 | goto out; |
2398 | 2398 | ||
2399 | lock_super(sb); | ||
2400 | if (EXT3_HAS_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER) && | 2399 | if (EXT3_HAS_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER) && |
2401 | sb->s_flags & MS_RDONLY) { | 2400 | sb->s_flags & MS_RDONLY) { |
2402 | EXT3_CLEAR_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER); | 2401 | EXT3_CLEAR_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER); |
2403 | ext3_commit_super(sb, es, 1); | 2402 | ext3_commit_super(sb, es, 1); |
2404 | } | 2403 | } |
2405 | unlock_super(sb); | ||
2406 | 2404 | ||
2407 | out: | 2405 | out: |
2408 | journal_unlock_updates(journal); | 2406 | journal_unlock_updates(journal); |
@@ -2594,13 +2592,7 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data) | |||
2594 | (sbi->s_mount_state & EXT3_VALID_FS)) | 2592 | (sbi->s_mount_state & EXT3_VALID_FS)) |
2595 | es->s_state = cpu_to_le16(sbi->s_mount_state); | 2593 | es->s_state = cpu_to_le16(sbi->s_mount_state); |
2596 | 2594 | ||
2597 | /* | ||
2598 | * We have to unlock super so that we can wait for | ||
2599 | * transactions. | ||
2600 | */ | ||
2601 | unlock_super(sb); | ||
2602 | ext3_mark_recovery_complete(sb, es); | 2595 | ext3_mark_recovery_complete(sb, es); |
2603 | lock_super(sb); | ||
2604 | } else { | 2596 | } else { |
2605 | __le32 ret; | 2597 | __le32 ret; |
2606 | if ((ret = EXT3_HAS_RO_COMPAT_FEATURE(sb, | 2598 | if ((ret = EXT3_HAS_RO_COMPAT_FEATURE(sb, |