@@ -944,32 +944,16 @@ static int check_dir_block(ext2_filsys fs,
out_htree:
#endif /* ENABLE_HTREE */
- /* Verify checksum. */
- if (is_leaf && de_csum_size && !inline_data_size) {
- /* No space for csum? Rebuild dirs in pass 3A. */
- if (!ext2fs_dirent_has_tail(fs, (struct ext2_dir_entry *)buf)) {
- de_csum_size = 0;
- if (e2fsck_dir_will_be_rehashed(ctx, ino))
- goto skip_checksum;
- if (!fix_problem(cd->ctx, PR_2_LEAF_NODE_MISSING_CSUM,
- &cd->pctx))
- goto skip_checksum;
- e2fsck_rehash_dir_later(ctx, ino);
+ /* Leaf node with no space for csum? Rebuild dirs in pass 3A. */
+ if (is_leaf && !inline_data_size && failed_csum &&
+ !ext2fs_dirent_has_tail(fs, (struct ext2_dir_entry *)buf)) {
+ de_csum_size = 0;
+ if (e2fsck_dir_will_be_rehashed(ctx, ino) ||
+ !fix_problem(cd->ctx, PR_2_LEAF_NODE_MISSING_CSUM,
+ &cd->pctx))
goto skip_checksum;
- }
- if (failed_csum) {
- char *buf2;
- if (!fix_problem(cd->ctx, PR_2_LEAF_NODE_CSUM_INVALID,
- &cd->pctx))
- goto skip_checksum;
- ext2fs_new_dir_block(fs,
- db->blockcnt == 0 ? ino : 0,
- EXT2_ROOT_INO, &buf2);
- memcpy(buf, buf2, fs->blocksize);
- ext2fs_free_mem(&buf2);
- dir_modified++;
- failed_csum = 0;
- }
+ e2fsck_rehash_dir_later(ctx, ino);
+ goto skip_checksum;
}
/* htree nodes don't use fake dirents to store checksums */
if (!is_leaf)
@@ -1477,11 +1477,6 @@ static struct e2fsck_problem problem_table[] = {
N_("@p @h %d: internal node fails checksum.\n"),
PROMPT_CLEAR_HTREE, PR_PREEN_OK },
- /* leaf node fails checksum */
- { PR_2_LEAF_NODE_CSUM_INVALID,
- N_("@d @i %i, %B, offset %N: @d fails checksum.\n"),
- PROMPT_SALVAGE, PR_PREEN_OK },
-
/* leaf node has no checksum */
{ PR_2_LEAF_NODE_MISSING_CSUM,
N_("@d @i %i, %B, offset %N: @d has no checksum.\n"),
@@ -879,9 +879,6 @@ struct problem_context {
/* htree node fails checksum */
#define PR_2_HTREE_NODE_CSUM_INVALID 0x02004A
-/* dir leaf node fails checksum */
-#define PR_2_LEAF_NODE_CSUM_INVALID 0x02004B
-
/* no space in leaf for checksum */
#define PR_2_LEAF_NODE_MISSING_CSUM 0x02004C