From 022c81aa194461d191c58254ad710bc617bcf05e Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Thu, 2 Aug 2012 20:47:44 -0400 Subject: [PATCH] tune2fs: store checksum algorithm type in superblock Actually records the checksum algorithm type in the superblock when enabling checksumming. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o --- misc/tune2fs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/misc/tune2fs.c b/misc/tune2fs.c index 8bb3bc3..bc3f832 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -702,6 +702,12 @@ static void rewrite_metadata_checksums(ext2_filsys fs) ext2fs_mark_bb_dirty(fs); fs->flags &= ~EXT2_FLAG_SUPER_ONLY; fs->flags &= ~EXT2_FLAG_IGNORE_CSUM_ERRORS; + if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super, + EXT4_FEATURE_RO_COMPAT_METADATA_CSUM)) + fs->super->s_checksum_type = EXT2_CRC32C_CHKSUM; + else + fs->super->s_checksum_type = 0; + ext2fs_mark_super_dirty(fs); } /* -- 1.8.3.1