From: Theodore Ts'o Date: Mon, 24 Dec 2012 15:50:20 +0000 (-0500) Subject: Merge branch 'maint' into next X-Git-Tag: v1.43-WIP-2015-05-18~406 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=ab83252174bf450e865e76d7c7347c9c39fccadf;p=tools%2Fe2fsprogs.git Merge branch 'maint' into next Conflicts: e2fsck/problem.c e2fsck/problem.h --- ab83252174bf450e865e76d7c7347c9c39fccadf diff --cc e2fsck/pass1.c index b5d3f12,a8231f4..319c28d --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@@ -1899,19 -1796,8 +1899,19 @@@ static void scan_extent_node(e2fsck_t c ext2fs_blocks_count(ctx->fs->super)) problem = PR_1_EXTENT_ENDS_BEYOND; + /* Corrupt but passes checks? Ask to fix checksum. */ + if (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)) + ext2fs_extent_replace(ehandle, 0, &extent); + } + if (problem) { - report_problem: + report_problem: pctx->blk = extent.e_pblk; pctx->blk2 = extent.e_lblk; pctx->num = extent.e_len; diff --cc e2fsck/problem.c index 78b05bb,ab67cff..5a834fd --- a/e2fsck/problem.c +++ b/e2fsck/problem.c @@@ -960,46 -946,14 +960,54 @@@ static struct e2fsck_problem problem_ta N_("@i %i has zero length extent\n\t(@n logical @b %c, physical @b %b)\n"), PROMPT_CLEAR, 0 }, + /* inode checksum does not match inode */ + { PR_1_INODE_CSUM_INVALID, + N_("@i %i checksum does not match @i. "), + PROMPT_CLEAR, PR_PREEN_OK }, + + /* inode passes checks, but checksum does not match inode */ + { PR_1_INODE_ONLY_CSUM_INVALID, + N_("@i %i passes checks, but checksum does not match @i. "), + PROMPT_FIX, PR_PREEN_OK }, + + /* Inode extent block checksum does not match extent */ + { PR_1_EXTENT_CSUM_INVALID, + N_("@i %i extent block checksum does not match extent\n\t(logical @b " + "%c, @n physical @b %b, len %N)\n"), + PROMPT_CLEAR, 0 }, + + /* + * Inode extent block passes checks, but checksum does not match + * extent + */ + { PR_1_EXTENT_ONLY_CSUM_INVALID, + N_("@i %i extent block passes checks, but checksum does not match " + "extent\n\t(logical @b %c, @n physical @b %b, len %N)\n"), + PROMPT_FIX, 0 }, + + /* Extended attribute block checksum for inode does not match. */ + { PR_1_EA_BLOCK_CSUM_INVALID, + N_("Extended attribute @a @b %b checksum for @i %i does not " + "match. "), + PROMPT_CLEAR, 0 }, + + /* + * Extended attribute block passes checks, but checksum for inode does + * not match. + */ + { PR_1_EA_BLOCK_ONLY_CSUM_INVALID, + N_("Extended attribute @a @b %b passes checks, but checksum for " + "@i %i does not match. "), + PROMPT_FIX, 0 }, + + /* + * Interior extent node logical offset doesn't match first node below it + */ + { PR_1_EXTENT_INDEX_START_INVALID, + N_("Interior @x node level %N of @i %i:\n" + "Logical start %b does not match logical start %c at next level. "), + PROMPT_FIX, 0 }, + /* Pass 1b errors */ /* Pass 1B: Rescan for duplicate/bad blocks */ diff --cc e2fsck/problem.h index 5caade4,aed524d..d2b6df4 --- a/e2fsck/problem.h +++ b/e2fsck/problem.h @@@ -568,24 -558,8 +568,26 @@@ struct problem_context /* Extent has zero length */ #define PR_1_EXTENT_LENGTH_ZERO 0x010066 +/* inode checksum does not match inode */ +#define PR_1_INODE_CSUM_INVALID 0x010067 + +/* inode passes checks, but checksum does not match inode */ +#define PR_1_INODE_ONLY_CSUM_INVALID 0x010068 + +/* extent block checksum does not match extent block */ +#define PR_1_EXTENT_CSUM_INVALID 0x010069 + +/* extent block passes checks, but checksum does not match extent block */ +#define PR_1_EXTENT_ONLY_CSUM_INVALID 0x01006A + +/* ea block checksum invalid */ +#define PR_1_EA_BLOCK_CSUM_INVALID 0x01006B + +/* ea block passes checks, but checksum invalid */ +#define PR_1_EA_BLOCK_ONLY_CSUM_INVALID 0x01006C + + /* Index start doesn't match start of next extent down */ + #define PR_1_EXTENT_INDEX_START_INVALID 0x01006D /* * Pass 1b errors