Skip to contentSkip to conversation

EXT4: Avoid double dirtying of super block in ext4_put_super()

PATCH In review Andi Kleen 2 participants 2 messages Oct 6, 2008 ext4 file system

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 EXT4: Avoid double dirtying of super block in ext4_put_super()

EXT4: Avoid double dirtying of super block in ext4_put_super()

While reading code I noticed that ext4_put_super() dirties the superblock bh twice. It is always done in ext4_commit_super() too. Remove the redundant dirty operation.

Should be a nop semantically.

fs/ext4/super.c renamed from fs/ext4/super.c-o +0 -2
diff -up linux-2.6.27-rc6-csum/fs/ext4/super.c-o linux-2.6.27-rc6-csum/fs/ext4/super.c
@@ -508,8 +509,6 @@
 	if (!(sb->s_flags & MS_RDONLY)) {
 		EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
 		es->s_state = cpu_to_le16(sbi->s_mount_state);
-		BUFFER_TRACE(sbi->s_sbh, "marking dirty");
-		mark_buffer_dirty(sbi->s_sbh);
 		ext4_commit_super(sb, es, 1);
 	}
 
maintainer
#1 lore raw
Quoted 9 lines · Andi Kleen

EXT4: Avoid double dirtying of super block in ext4_put_super()

While reading code I noticed that ext4_put_super() dirties the superblock bh twice. It is always done in ext4_commit_super() too. Remove the redundant dirty operation.

Should be a nop semantically.

As it turns out, I had taken out the mark_buffer_dirty as superfluous in the following patch:

ext4/jbd2: Avoid WARN() messages when failing to write to the superblock

(This was Arjan's favorite ext3/ext4 top-ten kerneloops.org bug).

However I didn't kill the BUFFER_TRACE(sbi->s_sbh, "marking dirty"); line, which should have been deleted too. I'll take out the change from my patch since it's really unrelated to fixing the kerneloops.org WARN'ing, and take your patch and it include it for submission to Linus in the ext3 tree.

Thanks,

- Ted