summaryrefslogtreecommitdiff
path: root/e2fsck
diff options
context:
space:
mode:
Diffstat (limited to 'e2fsck')
-rw-r--r--e2fsck/pass2.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c
index 761c2f1f..2847901b 100644
--- a/e2fsck/pass2.c
+++ b/e2fsck/pass2.c
@@ -1007,13 +1007,18 @@ out_htree:
}
}
- if (!(ext2fs_test_inode_bitmap(ctx->inode_used_map,
- dirent->inode))) {
- /*
- * If the inode is unused, offer to clear it.
- */
+ /*
+ * Offer to clear unused inodes; if we are going to be
+ * restarting the scan due to bg_itable_unused being
+ * wrong, then don't clear any inodes to avoid zapping
+ * inodes that were skipped during pass1 due to an
+ * incorrect bg_itable_unused; we'll get any real
+ * problems after we restart.
+ */
+ if (!(ctx->flags & E2F_FLAG_RESTART_LATER) &&
+ !(ext2fs_test_inode_bitmap(ctx->inode_used_map,
+ dirent->inode)))
problem = PR_2_UNUSED_INODE;
- }
if (problem) {
if (fix_problem(ctx, problem, &cd->pctx)) {