From eb4ab51044706e52fc78907130f2cb9458a7023b Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 13 Aug 2001 10:58:41 -0400 Subject: [PATCH] super.c (release_orphan_inodes): If the filesystem contains errors, don't run the orphan * list, since the orphan list can't be trusted. --- e2fsck/ChangeLog | 4 ++++ e2fsck/super.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 1591c9a..93648c4 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,5 +1,9 @@ 2001-08-13 Theodore Tso + * super.c (release_orphan_inodes): If the filesystem contains + errors, don't run the orphan * list, since the orphan list + can't be trusted. + * pass1.c (check_size): Fix logic in check_size; the previous code only offered to clear the inode size fields if both size and i_size_high were zero. diff --git a/e2fsck/super.c b/e2fsck/super.c index 1e67d1c..ceac78b 100644 --- a/e2fsck/super.c +++ b/e2fsck/super.c @@ -237,6 +237,14 @@ static int release_orphan_inodes(e2fsck_t ctx) */ fs->super->s_last_orphan = 0; ext2fs_mark_super_dirty(fs); + + /* + * If the filesystem contains errors, don't run the orphan + * list, since the orphan list can't be trusted; and we're + * going to be running a full e2fsck run anyway... + */ + if (fs->super->s_state & EXT2_ERROR_FS) + return 0; if ((ino < EXT2_FIRST_INODE(fs->super)) || (ino > fs->super->s_inodes_count)) { -- 1.8.3.1