From: Theodore Ts'o Date: Fri, 25 Jul 2014 12:58:10 +0000 (-0400) Subject: Merge branch 'maint' into next X-Git-Tag: v1.43-WIP-2015-05-18~271 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e05a05630ae942cdd62ed1deb694444eeaac7107;p=thirdparty%2Fe2fsprogs.git Merge branch 'maint' into next Conflicts: e2fsck/pass1.c e2fsck/problem.h --- e05a05630ae942cdd62ed1deb694444eeaac7107 diff --cc e2fsck/pass1.c index 648c578d7,dc15db29d..10ffe3946 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@@ -1970,20 -1806,22 +1970,36 @@@ static void scan_extent_node(e2fsck_t c (1 << (21 - ctx->fs->super->s_log_block_size)))) problem = PR_1_TOOBIG_DIR; + /* Corrupt but passes checks? Ask to fix checksum. */ + if (try_repairs && failed_csum) { + pctx->blk = extent.e_pblk; + pctx->blk2 = extent.e_lblk; + pctx->num = extent.e_len; + problem = 0; + if (fix_problem(ctx, PR_1_EXTENT_ONLY_CSUM_INVALID, + pctx)) { + pb->inode_modified = 1; + ext2fs_extent_replace(ehandle, 0, &extent); + } + } + + /* + * Uninitialized blocks in a directory? Clear the flag and + * we'll interpret the blocks later. + */ - if (is_dir && problem == 0 && ++ if (try_repairs && is_dir && problem == 0 && + (extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT) && + fix_problem(ctx, PR_1_UNINIT_DBLOCK, pctx)) { + extent.e_flags &= ~EXT2_EXTENT_FLAGS_UNINIT; + pb->inode_modified = 1; + pctx->errcode = ext2fs_extent_replace(ehandle, 0, + &extent); + if (pctx->errcode) + return; ++ failed_csum = 0; + } + - if (problem) { + if (try_repairs && problem) { report_problem: pctx->blk = extent.e_pblk; pctx->blk2 = extent.e_lblk;