summaryrefslogtreecommitdiff
path: root/e2fsck/pass3.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@us.ibm.com>2012-08-02 17:27:43 -0400
committerTheodore Ts'o <tytso@mit.edu>2012-08-02 17:27:43 -0400
commite8548796a5bb59b2319c81973b7a460f036faa3e (patch)
treefeab6fe670c50237059a740f083205c25a5be763 /e2fsck/pass3.c
parent81683c6a32045cf04d76a024e6f1753535b97c22 (diff)
downloade2fsprogs-e8548796a5bb59b2319c81973b7a460f036faa3e.tar.gz
e2fsck: check directory leaf block checksums
Checks that directory leaf blocks have the necessary fake dir_entry at the end of the block to hold a checksum and that the checksum is valid. It will resize the block and/or rebuild the directory if necessary. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'e2fsck/pass3.c')
-rw-r--r--e2fsck/pass3.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/e2fsck/pass3.c b/e2fsck/pass3.c
index 4ae3a338..ad733c23 100644
--- a/e2fsck/pass3.c
+++ b/e2fsck/pass3.c
@@ -659,8 +659,12 @@ static void fix_dotdot(e2fsck_t ctx, ext2_ino_t ino, ext2_ino_t parent)
clear_problem_context(&pctx);
pctx.ino = ino;
+ if (e2fsck_dir_will_be_rehashed(ctx, ino))
+ ctx->fs->flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS;
retval = ext2fs_dir_iterate(fs, ino, DIRENT_FLAG_INCLUDE_EMPTY,
0, fix_dotdot_proc, &fp);
+ if (e2fsck_dir_will_be_rehashed(ctx, ino))
+ ctx->fs->flags &= ~EXT2_FLAG_IGNORE_CSUM_ERRORS;
if (retval || !fp.done) {
pctx.errcode = retval;
fix_problem(ctx, retval ? PR_3_FIX_PARENT_ERR :