summaryrefslogtreecommitdiff
path: root/e2fsck/pass3.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2014-12-13 21:55:22 -0500
committerTheodore Ts'o <tytso@mit.edu>2014-12-13 21:55:22 -0500
commit506fc404bad01a34213b8d62ed0be8499f6a8eca (patch)
treeeb76aa63ec4f711764d015552f093170f0bef644 /e2fsck/pass3.c
parentd02d019557d993c8dfe2f7d0fea841101f0d9e61 (diff)
downloade2fsprogs-506fc404bad01a34213b8d62ed0be8499f6a8eca.tar.gz
e2fsck: don't complain about root dir csum failures when getting lnf
Don't complain about checksum failures on the root dir when we're trying to find l+f if the root dir is going to be rehashed anyway. The test case for this is t_enable_mcsum in the next patch. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'e2fsck/pass3.c')
-rw-r--r--e2fsck/pass3.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/e2fsck/pass3.c b/e2fsck/pass3.c
index 2d94ece8..1d5255f6 100644
--- a/e2fsck/pass3.c
+++ b/e2fsck/pass3.c
@@ -384,14 +384,23 @@ ext2_ino_t e2fsck_get_lost_and_found(e2fsck_t ctx, int fix)
char * block;
static const char name[] = "lost+found";
struct problem_context pctx;
+ int will_rehash, flags;
if (ctx->lost_and_found)
return ctx->lost_and_found;
clear_problem_context(&pctx);
+ will_rehash = e2fsck_dir_will_be_rehashed(ctx, EXT2_ROOT_INO);
+ if (will_rehash) {
+ flags = ctx->fs->flags;
+ ctx->fs->flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS;
+ }
retval = ext2fs_lookup(fs, EXT2_ROOT_INO, name,
sizeof(name)-1, 0, &ino);
+ if (will_rehash)
+ ctx->fs->flags = (flags & EXT2_FLAG_IGNORE_CSUM_ERRORS) |
+ (ctx->fs->flags & ~EXT2_FLAG_IGNORE_CSUM_ERRORS);
if (retval && !fix)
return 0;
if (!retval) {