Skip to contentSkip to conversation

ext3: call ext3_mark_recovery_complete() when recovery is really needed

PATCH In review Eryu Guan 2 participants 4 messages Nov 1, 2011 – Nov 3, 2011

lore
Share & tools
lore

Eryu Guan

author
#0 lore raw

PATCH 1/1 ext3: call ext3_mark_recovery_complete() when recovery is really needed

Call ext3_mark_recovery_complete() in ext3_fill_super() only if needs_recovery is non-zero.

Besides that, print out "recovery complete" message after calling ext3_mark_recovery_complete().

---
 fs/ext3/super.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
fs/ext3/super.c +3 -2
index 7beb69a..2681e0d 100644
@@ -2060,9 +2060,10 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
 	EXT3_SB(sb)->s_mount_state |= EXT3_ORPHAN_FS;
 	ext3_orphan_cleanup(sb, es);
 	EXT3_SB(sb)->s_mount_state &= ~EXT3_ORPHAN_FS;
-	if (needs_recovery)
+	if (needs_recovery) {
+		ext3_mark_recovery_complete(sb, es);
 		ext3_msg(sb, KERN_INFO, "recovery complete");
-	ext3_mark_recovery_complete(sb, es);
+	}
 	ext3_msg(sb, KERN_INFO, "mounted filesystem with %s data mode",
 		test_opt(sb,DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA ? "journal":
 		test_opt(sb,DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA ? "ordered":
Signature · 1 line
1.7.7.1
#1 lore raw
Quoted 5 lines · Eryu Guan

Call ext3_mark_recovery_complete() in ext3_fill_super() only if needs_recovery is non-zero.

Besides that, print out "recovery complete" message after calling ext3_mark_recovery_complete().

OK, I don't see a problem in this patch. But is there some benefit in it?
I'm slightly nervous it could change something subtle...

Honza

Quoted 27 lines
---
 fs/ext3/super.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
fs/ext3/super.c +3 -2
index 7beb69a..2681e0d 100644
@@ -2060,9 +2060,10 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
 	EXT3_SB(sb)->s_mount_state |= EXT3_ORPHAN_FS;
 	ext3_orphan_cleanup(sb, es);
 	EXT3_SB(sb)->s_mount_state &= ~EXT3_ORPHAN_FS;
-	if (needs_recovery)
+	if (needs_recovery) {
+		ext3_mark_recovery_complete(sb, es);
 		ext3_msg(sb, KERN_INFO, "recovery complete");
-	ext3_mark_recovery_complete(sb, es);
+	}
 	ext3_msg(sb, KERN_INFO, "mounted filesystem with %s data mode",
 		test_opt(sb,DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA ? "journal":
 		test_opt(sb,DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA ? "ordered":
Signature · 1 line
1.7.7.1
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
author
#2 lore raw
Quoted 8 lines · Jan Kara
Quoted 5 lines · Eryu Guan

Call ext3_mark_recovery_complete() in ext3_fill_super() only if needs_recovery is non-zero.

Besides that, print out "recovery complete" message after calling ext3_mark_recovery_complete().

 OK, I don't see a problem in this patch. But is there some benefit in it? I'm slightly nervous it could change something subtle...

I think current code may confuse people. The variable 'needs_recovery' in ext3_fill_super() only be used in this 'if' switch, but all the 'if' does is printing
out a log message and no matter what value 'needs_recovery' is, ext3_mark_recovery_complete() is always being called.

This change makes the logic more clear and of course reduce a little overhead when mounting clean fs.

This change also consists with ext4 counter part
3733 if (needs_recovery) {
3734 ext4_msg(sb, KERN_INFO, "recovery complete");
3735 ext4_mark_recovery_complete(sb, es);
3736 }

But, yes, current code exists for a long time and no one complains about it, the change is trivial. If people worry more, I'm fine with skipping this patch.

Thanks.
Eryu Guan

Quoted 24 lines

                                                               Honza

Quoted 22 lines

---
 fs/ext3/super.c |    5 +++--

 1 files changed, 3 insertions(+), 2 deletions(-)
fs/ext3/super.c +3 -2
index 7beb69a..2681e0d 100644
@@ -2060,9 +2060,10 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
       EXT3_SB(sb)->s_mount_state |= EXT3_ORPHAN_FS;
       ext3_orphan_cleanup(sb, es);
       EXT3_SB(sb)->s_mount_state &= ~EXT3_ORPHAN_FS;
-     if (needs_recovery)
+     if (needs_recovery) {
+             ext3_mark_recovery_complete(sb, es);
               ext3_msg(sb, KERN_INFO, "recovery complete");
-     ext3_mark_recovery_complete(sb, es);
+     }
       ext3_msg(sb, KERN_INFO, "mounted filesystem with %s data mode",
Quoted 9 lines
Quoted 5 lines

              test_opt(sb,DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA ? "journal":
              test_opt(sb,DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA ? "ordered":
--
1.7.7.1

--
Jan Kara <[email protected]>
SUSE Labs, CR

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 16 lines · Eryu Guan
Quoted 8 lines · Jan Kara
Quoted 5 lines · Eryu Guan

Call ext3_mark_recovery_complete() in ext3_fill_super() only if needs_recovery is non-zero.

Besides that, print out "recovery complete" message after calling ext3_mark_recovery_complete().

 OK, I don't see a problem in this patch. But is there some benefit in it? I'm slightly nervous it could change something subtle...

I think current code may confuse people. The variable 'needs_recovery' in ext3_fill_super() only be used in this 'if' switch, but all the 'if' does is printing
out a log message and no matter what value 'needs_recovery' is, ext3_mark_recovery_complete() is always being called.

Quoted 8 lines

This change makes the logic more clear and of course reduce a little overhead when mounting clean fs.

This change also consists with ext4 counter part
3733 if (needs_recovery) {
3734 ext4_msg(sb, KERN_INFO, "recovery complete");
3735 ext4_mark_recovery_complete(sb, es);
3736 }

OK, consistency with ext4 makes sense. I'll take the patch. Thanks.

Honza

Quoted 30 lines
Quoted 30 lines
Quoted 21 lines

---
 fs/ext3/super.c |    5 +++--

 1 files changed, 3 insertions(+), 2 deletions(-)
fs/ext3/super.c +3 -2
index 7beb69a..2681e0d 100644
@@ -2060,9 +2060,10 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
       EXT3_SB(sb)->s_mount_state |= EXT3_ORPHAN_FS;
       ext3_orphan_cleanup(sb, es);
       EXT3_SB(sb)->s_mount_state &= ~EXT3_ORPHAN_FS;
-     if (needs_recovery)
+     if (needs_recovery) {
+             ext3_mark_recovery_complete(sb, es);
               ext3_msg(sb, KERN_INFO, "recovery complete");
-     ext3_mark_recovery_complete(sb, es);
+     }
       ext3_msg(sb, KERN_INFO, "mounted filesystem with %s data mode",
Quoted 5 lines

              test_opt(sb,DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA ? "journal":
              test_opt(sb,DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA ? "ordered":
--
1.7.7.1

--
Jan Kara <[email protected]>
SUSE Labs, CR

Signature · 6 lines
Jan Kara <[email protected]>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html