@@ -729,7 +729,8 @@ void e2fsck_pass1(e2fsck_t ctx)
ext2fs_mark_inode_bitmap2(ctx->inode_used_map, ino);
continue;
}
- if (pctx.errcode) {
+ if (pctx.errcode &&
+ pctx.errcode != EXT2_ET_INODE_CSUM_INVALID) {
fix_problem(ctx, PR_1_ISCAN_ERROR, &pctx);
ctx->flags |= E2F_FLAG_ABORT;
return;
@@ -739,6 +740,12 @@ void e2fsck_pass1(e2fsck_t ctx)
pctx.ino = ino;
pctx.inode = inode;
ctx->stashed_ino = ino;
+
+ /* Clear corrupt inode */
+ if (pctx.errcode == EXT2_ET_INODE_CSUM_INVALID &&
+ fix_problem(ctx, PR_1_INODE_CSUM_INVALID, &pctx))
+ goto clear_inode;
+
if (inode->i_links_count) {
pctx.errcode = ext2fs_icount_store(ctx->inode_link_info,
ino, inode->i_links_count);
@@ -934,7 +934,12 @@ static struct e2fsck_problem problem_table[] = {
/* Quota inode is user visible */
{ PR_1_QUOTA_INODE_NOT_HIDDEN,
N_("@q @i is visible to the user. "),
- PROMPT_CLEAR, PR_PREEN_OK },
+ PROMPT_FIX, PR_PREEN_OK },
+
+ /* inode checksum does not match inode */
+ { PR_1_INODE_CSUM_INVALID,
+ N_("@i %i checksum does not match @i. "),
+ PROMPT_FIX, PR_PREEN_OK },
/* Invalid bad inode */
{ PR_1_INVALID_BAD_INODE,
@@ -550,6 +550,9 @@ struct problem_context {
/* Invalid bad inode */
#define PR_1_INVALID_BAD_INODE 0x010065
+/* inode checksum does not match inode */
+#define PR_1_INODE_CSUM_INVALID 0x010066
+
/*
* Pass 1b errors
*/
Detect mismatches of the inode and checksum, and prompt the user to fix the situation. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> --- e2fsck/pass1.c | 9 ++++++++- e2fsck/problem.c | 7 ++++++- e2fsck/problem.h | 3 +++ 3 files changed, 17 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html