diff mbox

[20/47] tune2fs: warn if extents are not enabled when turning on metadata_csum

Message ID 20141107215257.883.38333.stgit@birch.djwong.org
State Accepted, archived
Headers show

Commit Message

Darrick Wong Nov. 7, 2014, 9:52 p.m. UTC
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@oracle.com>
---
 misc/tune2fs.c |    8 ++++++++
 1 file changed, 8 insertions(+)



--
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

Comments

Theodore Ts'o Dec. 14, 2014, 2:58 a.m. UTC | #1
On Fri, Nov 07, 2014 at 01:52:57PM -0800, Darrick J. Wong wrote:
> 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@oracle.com>

Applied, thanks.

					- Ted
--
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
diff mbox

Patch

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 &=