@@ -583,6 +583,7 @@ void e2fsck_pass1(e2fsck_t ctx)
ext2_ino_t ino = 0;
struct ext2_inode *inode;
ext2_inode_scan scan;
+ errcode_t csum_errcode;
char *block_buf;
#ifdef RESOURCE_TRACK
struct resource_track rtrack;
@@ -788,12 +789,7 @@ void e2fsck_pass1(e2fsck_t ctx)
pctx.inode = inode;
ctx->stashed_ino = ino;
- /* Clear corrupt inode? */
- if (pctx.errcode == EXT2_ET_INODE_CSUM_INVALID) {
- if (fix_problem(ctx, PR_1_INODE_CSUM_INVALID, &pctx))
- goto clear_inode;
- failed_csum = 1;
- }
+ csum_errcode = pctx.errcode;
if (inode->i_links_count) {
pctx.errcode = ext2fs_icount_store(ctx->inode_link_info,
@@ -1063,6 +1059,14 @@ void e2fsck_pass1(e2fsck_t ctx)
}
continue;
}
+
+ /* Clear corrupt inode? */
+ if (csum_errcode == EXT2_ET_INODE_CSUM_INVALID) {
+ if (fix_problem(ctx, PR_1_INODE_CSUM_INVALID, &pctx))
+ goto clear_inode;
+ failed_csum = 1;
+ }
+
/*
* n.b. 0.3c ext2fs code didn't clear i_links_count for
* deleted files. Oops.