Warn the user if we're trying to enable metadata_csum on a FS that doesn't support extents (since block maps cannot contain checksums). Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> --- misc/tune2fs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/misc/tune2fs.c b/misc/tune2fs.c index 7fee870..6feaab1 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -1113,6 +1113,14 @@ mmp_error: if (mount_flags & EXT2_MF_MOUNTED) fputs(_("Cannot enable metadata_csum on a mounted " "filesystem!\n"), stderr); + if (!EXT2_HAS_INCOMPAT_FEATURE(fs->super, + EXT3_FEATURE_INCOMPAT_EXTENTS)) + printf("%s", + _("Extents are not enabled. The file extent " + "tree can be checksummed, whereas block maps " + "cannot. Not enabling extents reduces the " + "coverage of metadata checksumming. " + "Re-run with -O extent to rectify.\n")); rewrite_checksums = 1; /* metadata_csum supersedes uninit_bg */ fs->super->s_feature_ro_compat &= -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html