Skip to content

Commit 4854a5f

Browse files
Eric Sandeenjankara
authored andcommitted
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 a63c9eb 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>
1 parent ed505ee commit 4854a5f

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

‎fs/ext3/super.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2396,13 +2396,11 @@ static void ext3_mark_recovery_complete(struct super_block * sb,
23962396
if (journal_flush(journal) < 0)
23972397
goto out;
23982398

2399-
lock_super(sb);
24002399
if (EXT3_HAS_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER) &&
24012400
sb->s_flags & MS_RDONLY) {
24022401
EXT3_CLEAR_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER);
24032402
ext3_commit_super(sb, es, 1);
24042403
}
2405-
unlock_super(sb);
24062404

24072405
out:
24082406
journal_unlock_updates(journal);
@@ -2594,13 +2592,7 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data)
25942592
(sbi->s_mount_state & EXT3_VALID_FS))
25952593
es->s_state = cpu_to_le16(sbi->s_mount_state);
25962594

2597-
/*
2598-
* We have to unlock super so that we can wait for
2599-
* transactions.
2600-
*/
2601-
unlock_super(sb);
26022595
ext3_mark_recovery_complete(sb, es);
2603-
lock_super(sb);
26042596
} else {
26052597
__le32 ret;
26062598
if ((ret = EXT3_HAS_RO_COMPAT_FEATURE(sb,

0 commit comments

Comments
 (0)