@@ -1074,7 +1074,8 @@ static __u32 ok_features[3] = {
EXT4_FEATURE_INCOMPAT_MMP |
EXT4_FEATURE_INCOMPAT_64BIT|
EXT4_FEATURE_INCOMPAT_INLINE_DATA|
- EXT4_FEATURE_INCOMPAT_ENCRYPT,
+ EXT4_FEATURE_INCOMPAT_ENCRYPT |
+ EXT4_FEATURE_INCOMPAT_CSUM_SEED,
/* R/O compat */
EXT2_FEATURE_RO_COMPAT_LARGE_FILE|
EXT4_FEATURE_RO_COMPAT_HUGE_FILE|
@@ -2775,6 +2776,13 @@ int main (int argc, char *argv[])
"Pass -O 64bit to rectify.\n"));
}
+ if (ext2fs_has_feature_csum_seed(fs->super) &&
+ !ext2fs_has_feature_metadata_csum(fs->super)) {
+ printf("%s", _("The metadata_csum_seed feature "
+ "requres the metadata_csum feature.\n"));
+ exit(1);
+ }
+
/* Calculate journal blocks */
if (!journal_device && ((journal_size) ||
ext2fs_has_feature_journal(&fs_param)))
@@ -2830,6 +2838,11 @@ int main (int argc, char *argv[])
}
} else
uuid_generate(fs->super->s_uuid);
+
+ if (ext2fs_has_feature_csum_seed(fs->super))
+ fs->super->s_checksum_seed = ext2fs_crc32c_le(~0,
+ fs->super->s_uuid, sizeof(fs->super->s_uuid));
+
ext2fs_init_csum_seed(fs);
/*
Allow users to turn on metadata_csum_seed at format time so that UUIDs can be live-changed at any time. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> --- misc/mke2fs.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) -- 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