Skip to content

Commit

Permalink
tune2fs: warn if extents are not enabled when turning on metadata_csum
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
djwong authored and tytso committed Dec 14, 2014
1 parent 506fc40 commit a742a12
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions misc/tune2fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,14 @@ static int update_feature_set(ext2_filsys fs, char *features)
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 &=
Expand Down

0 comments on commit a742a12

Please sign in to comment.