From: Theodore Ts'o Date: Thu, 27 Nov 2008 01:41:26 +0000 (-0500) Subject: e2fsck: Don't cancel the fsck run after clearing an errant INODE_UNINIT flag X-Git-Tag: v1.41.4~36 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=42e89ce7f8823ad14099b03469c2f4e4f6530d05;p=thirdparty%2Fe2fsprogs.git e2fsck: Don't cancel the fsck run after clearing an errant INODE_UNINIT flag Thanks to Kelly Kane from Dreamhost for reporting this bug and then helping us find and fix it. Signed-off-by: "Theodore Ts'o" --- diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c index f479df663..28badc9a5 100644 --- a/e2fsck/pass2.c +++ b/e2fsck/pass2.c @@ -980,20 +980,20 @@ out_htree: cd->pctx.group = group; /* - * Check if the inode was missed out because _INODE_UNINIT - * flag was set or bg_itable_unused was incorrect. - * If that is the case restart e2fsck. - * XXX Optimisations TODO: - * 1. only restart e2fsck once - * 2. only exposed inodes are checked again. + * Check if the inode was missed out because + * _INODE_UNINIT flag was set or bg_itable_unused was + * incorrect. If so, clear the _INODE_UNINIT flag and + * restart e2fsck. In the future it would be nice if + * we could call a function in pass1.c that checks the + * newly visible inodes. */ if (fs->group_desc[group].bg_flags & EXT2_BG_INODE_UNINIT) { if (fix_problem(ctx, PR_2_INOREF_BG_INO_UNINIT, &cd->pctx)){ fs->group_desc[group].bg_flags &= ~EXT2_BG_INODE_UNINIT; - ctx->flags |= E2F_FLAG_RESTART | - E2F_FLAG_SIGNAL_MASK; + ext2fs_mark_super_dirty(fs); + ctx->flags |= E2F_FLAG_RESTART; } else { ext2fs_unmark_valid(fs); if (problem == PR_2_BAD_INO) @@ -1002,8 +1002,6 @@ out_htree: } else if (dirent->inode >= first_unused_inode) { if (fix_problem(ctx, PR_2_INOREF_IN_UNUSED, &cd->pctx)){ fs->group_desc[group].bg_itable_unused = 0; - fs->group_desc[group].bg_flags &= - ~EXT2_BG_INODE_UNINIT; ext2fs_mark_super_dirty(fs); ctx->flags |= E2F_FLAG_RESTART; goto restart_fsck;