From a742a128a04109a7c59a8520ec84674e17e35b1e Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Sat, 13 Dec 2014 21:57:20 -0500 Subject: [PATCH] tune2fs: warn if extents are not enabled when turning on metadata_csum 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 Signed-off-by: Theodore Ts'o --- misc/tune2fs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/misc/tune2fs.c b/misc/tune2fs.c index 34d2cd9..31fbe55 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 &= -- 1.8.3.1