mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] 2.5.68 fs/ext3/super.c fix for orphan recovery error path
@ 2003-04-21 20:14 Ernie Petrides
  2003-04-21 22:08 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Ernie Petrides @ 2003-04-21 20:14 UTC (permalink / raw)
  To: Stephen Tweedie, Andrew Morton; +Cc: linux-kernel

Stephen/Andrew, please consider applying this patch to reverse the order
of checks in ext3_orphan_cleanup() for read-only mounts and prior errors.

The problem resolved by this patch is that if a root file system has an
error recorded from a previous mount, and then (when rebooting) the orphan
recovery procedure is initiated, the recovery is correctly skipped but the
file system is incorrectly left in a writable state.

This causes the subsequent fsck to fail due to the root file system
being dirty, and then requires manual intervention to get the system
fully booted.

Thanks in advance.  -ernie



diff -urpN linux-2.5.68/fs/ext3/super.c{.orig,}
--- linux-2.5.68/fs/ext3/super.c.orig	2003-04-19 22:50:47.000000000 -0400
+++ linux-2.5.68/fs/ext3/super.c	2003-04-21 15:18:08.000000000 -0400
@@ -982,12 +982,6 @@ static void ext3_orphan_cleanup (struct 
 		return;
 	}
 
-	if (s_flags & MS_RDONLY) {
-		printk(KERN_INFO "EXT3-fs: %s: orphan cleanup on readonly fs\n",
-		       sb->s_id);
-		sb->s_flags &= ~MS_RDONLY;
-	}
-
 	if (EXT3_SB(sb)->s_mount_state & EXT3_ERROR_FS) {
 		if (es->s_last_orphan)
 			jbd_debug(1, "Errors on filesystem, "
@@ -997,6 +991,12 @@ static void ext3_orphan_cleanup (struct 
 		return;
 	}
 
+	if (s_flags & MS_RDONLY) {
+		printk(KERN_INFO "EXT3-fs: %s: orphan cleanup on readonly fs\n",
+		       sb->s_id);
+		sb->s_flags &= ~MS_RDONLY;
+	}
+
 	while (es->s_last_orphan) {
 		struct inode *inode;
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] 2.5.68 fs/ext3/super.c fix for orphan recovery error path
  2003-04-21 20:14 [PATCH] 2.5.68 fs/ext3/super.c fix for orphan recovery error path Ernie Petrides
@ 2003-04-21 22:08 ` Andrew Morton
  2003-04-28 14:23   ` Stephen C. Tweedie
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2003-04-21 22:08 UTC (permalink / raw)
  To: Ernie Petrides; +Cc: sct, linux-kernel

Ernie Petrides <petrides@redhat.com> wrote:
>
> Stephen/Andrew, please consider applying this patch to reverse the order
> of checks in ext3_orphan_cleanup() for read-only mounts and prior errors.
> 

Thanks, that is definitely needed.  We should do this in 2.4 as well.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] 2.5.68 fs/ext3/super.c fix for orphan recovery error path
  2003-04-21 22:08 ` Andrew Morton
@ 2003-04-28 14:23   ` Stephen C. Tweedie
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen C. Tweedie @ 2003-04-28 14:23 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Ernie Petrides, linux-kernel, Stephen Tweedie

Hi,

On Mon, 2003-04-21 at 23:08, Andrew Morton wrote:
> Ernie Petrides <petrides@redhat.com> wrote:
> >
> > Stephen/Andrew, please consider applying this patch to reverse the order
> > of checks in ext3_orphan_cleanup() for read-only mounts and prior errors.
> > 
> 
> Thanks, that is definitely needed.  We should do this in 2.4 as well.

Yes, I'll push it to marcelo.

--Stephen


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-04-28 14:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-21 20:14 [PATCH] 2.5.68 fs/ext3/super.c fix for orphan recovery error path Ernie Petrides
2003-04-21 22:08 ` Andrew Morton
2003-04-28 14:23   ` Stephen C. Tweedie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®