diff options
author | Eric Sandeen <sandeen@redhat.com> | 2012-08-27 15:30:40 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2012-09-03 18:06:26 -0400 |
commit | e4230108547766f4e105a62c45f3724309106f91 (patch) | |
tree | 7aa54e8427892515c822939bd72ee9bd36afb5b0 /fs/ext3 | |
parent | da02eb72f150bef1d281d93b3e4716ce374c4510 (diff) |
ext3: don't clear orphan list on ro mount with errors
When we have a filesystem with an orphan inode list *and* in error
state, things behave differently if:
1) e2fsck -p is done prior to mount: e2fsck fixes things and exits
happily (barring other significant problems)
vs.
2) mount is done first, then e2fsck -p: due to the orphan inode
list removal, more errors are found and e2fsck exits with
UNEXPECTED INCONSISTENCY.
The 2nd case above, on the root filesystem, has the tendency to halt
the boot process, which is unfortunate.
The situation can be improved by not clearing the orphan
inode list when the fs is mounted readonly.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext3')
-rw-r--r-- | fs/ext3/super.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 8c892e93d8e7..d90ad0574705 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -1479,10 +1479,12 @@ static void ext3_orphan_cleanup (struct super_block * sb, | |||
1479 | } | 1479 | } |
1480 | 1480 | ||
1481 | if (EXT3_SB(sb)->s_mount_state & EXT3_ERROR_FS) { | 1481 | if (EXT3_SB(sb)->s_mount_state & EXT3_ERROR_FS) { |
1482 | if (es->s_last_orphan) | 1482 | /* don't clear list on RO mount w/ errors */ |
1483 | if (es->s_last_orphan && !(s_flags & MS_RDONLY)) { | ||
1483 | jbd_debug(1, "Errors on filesystem, " | 1484 | jbd_debug(1, "Errors on filesystem, " |
1484 | "clearing orphan list.\n"); | 1485 | "clearing orphan list.\n"); |
1485 | es->s_last_orphan = 0; | 1486 | es->s_last_orphan = 0; |
1487 | } | ||
1486 | jbd_debug(1, "Skipping orphan recovery on fs with errors.\n"); | 1488 | jbd_debug(1, "Skipping orphan recovery on fs with errors.\n"); |
1487 | return; | 1489 | return; |
1488 | } | 1490 | } |