Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Eric Sandeen and committed by
Jan Kara
4854a5f0 ed505ee4

-8
-8
fs/ext3/super.c
··· 2396 2396 if (journal_flush(journal) < 0) 2397 2397 goto out; 2398 2398 2399 - lock_super(sb); 2400 2399 if (EXT3_HAS_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER) && 2401 2400 sb->s_flags & MS_RDONLY) { 2402 2401 EXT3_CLEAR_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER); 2403 2402 ext3_commit_super(sb, es, 1); 2404 2403 } 2405 - unlock_super(sb); 2406 2404 2407 2405 out: 2408 2406 journal_unlock_updates(journal); ··· 2592 2594 (sbi->s_mount_state & EXT3_VALID_FS)) 2593 2595 es->s_state = cpu_to_le16(sbi->s_mount_state); 2594 2596 2595 - /* 2596 - * We have to unlock super so that we can wait for 2597 - * transactions. 2598 - */ 2599 - unlock_super(sb); 2600 2597 ext3_mark_recovery_complete(sb, es); 2601 - lock_super(sb); 2602 2598 } else { 2603 2599 __le32 ret; 2604 2600 if ((ret = EXT3_HAS_RO_COMPAT_FEATURE(sb,