mirror of https://github.com/vitalif/e2fsprogs
e2fsck: check the checksum seed feature flag is set correctly
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>debian
parent
2be9cd8655
commit
17f2fbf737
|
@ -467,6 +467,11 @@ static struct e2fsck_problem problem_table[] = {
|
|||
N_("External @j @S checksum does not match @S. "),
|
||||
PROMPT_FIX, PR_PREEN_OK },
|
||||
|
||||
/* metadata_csum_seed means nothing without metadata_csum */
|
||||
{ PR_0_CSUM_SEED_WITHOUT_META_CSUM,
|
||||
N_("@S metadata_csum_seed is not necessary without metadata_csum."),
|
||||
PROMPT_FIX, PR_PREEN_OK | PR_NO_OK},
|
||||
|
||||
/* Pass 1 errors */
|
||||
|
||||
/* Pass 1: Checking inodes, blocks, and sizes */
|
||||
|
|
|
@ -268,6 +268,9 @@ struct problem_context {
|
|||
/* External journal has corrupt superblock */
|
||||
#define PR_0_EXT_JOURNAL_SUPER_CSUM_INVALID 0x00004A
|
||||
|
||||
/* metadata_csum_seed means nothing without metadata_csum */
|
||||
#define PR_0_CSUM_SEED_WITHOUT_META_CSUM 0x00004B
|
||||
|
||||
/*
|
||||
* Pass 1 errors
|
||||
*/
|
||||
|
|
|
@ -589,6 +589,15 @@ void check_super_block(e2fsck_t ctx)
|
|||
ext2fs_group_desc_csum_set(fs, i);
|
||||
}
|
||||
|
||||
/* We can't have ^metadata_csum,metadata_csum_seed */
|
||||
if (!ext2fs_has_feature_metadata_csum(fs->super) &&
|
||||
ext2fs_has_feature_csum_seed(fs->super) &&
|
||||
fix_problem(ctx, PR_0_CSUM_SEED_WITHOUT_META_CSUM, &pctx)) {
|
||||
ext2fs_clear_feature_csum_seed(fs->super);
|
||||
fs->super->s_checksum_seed = 0;
|
||||
ext2fs_mark_super_dirty(fs);
|
||||
}
|
||||
|
||||
/* Is 64bit set and extents unset? */
|
||||
if (ext2fs_has_feature_64bit(fs->super) &&
|
||||
!ext2fs_has_feature_extents(fs->super) &&
|
||||
|
|
Loading…
Reference in New Issue