ext2fs_group_desc_csum_verify() is always checking the bg_checksum (to
make sure it is zero) even when the GDT_CSUM feature is not present.
This is normally OK, but apparently there are filesystems in the wild
where this field has not be initialized to zero.
Addresses-Debian-Bug: #490637
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
int ext2fs_group_desc_csum_verify(ext2_filsys fs, dgrp_t group)
{
- if (fs->group_desc[group].bg_checksum !=
- ext2fs_group_desc_csum(fs, group))
+ if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
+ EXT4_FEATURE_RO_COMPAT_GDT_CSUM) &&
+ (fs->group_desc[group].bg_checksum !=
+ ext2fs_group_desc_csum(fs, group)))
return 0;
return 1;