summaryrefslogtreecommitdiff
path: root/e2fsck
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2010-05-11 15:12:52 -0400
committerTheodore Ts'o <tytso@mit.edu>2010-05-11 15:28:10 -0400
commit0433c1f1b72bb85d9ea11e7716a415a878a655c8 (patch)
tree125cd64b19ea17f440880f92fa632ae1a50d5e85 /e2fsck
parentd531450cdd9c9c356cce5bdb3634bccff31156f7 (diff)
downloade2fsprogs-0433c1f1b72bb85d9ea11e7716a415a878a655c8.tar.gz
e2fsck: Don't clear inodes if we found inodes that are in the unused region
Commit 6267ee4 avoided repeating pass #1 over and over again if multiple block groups are found with inodes in the bg_itable_unused region during pass #2. This caused a regression because the problem with not restarting pass #1 right away is that e2fsck will offer to clear directory entries for inodes that are deleted, and e2fsck can't easily distinguish between deleted inodes and inodes that were skipped because of an incorrect bg_itable_unused value. So once an inode is found in an unused region and we know that we're going to restart the e2fsck pass, don't offer to clear any deleted inodes --- since those will be caught in the second round. Addresses-Google-Bug: #2642165 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
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)) {