Commit d514577e authored by Andrew Morton's avatar Andrew Morton Committed by Christoph Hellwig

[PATCH] fs/ext3/super.c fix for orphan recovery error path

From: Ernie Petrides <petrides@redhat.com>

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.
parent d37224c6
......@@ -978,12 +978,6 @@ static void ext3_orphan_cleanup (struct super_block * sb,
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, "
......@@ -993,6 +987,12 @@ static void ext3_orphan_cleanup (struct super_block * sb,
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment