Thread (53 messages) 53 messages, 2 authors, 2011-11-29
STALE5352d
Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

[PATCH 35/50] tune2fs: Store checksum algorithm type in superblock

From: Darrick J. Wong <hidden>
Date: 2011-11-29 00:32:11
Subsystem: the rest · Maintainer: Linus Torvalds

Actually records the checksum algorithm type in the superblock when enabling
checksumming.

Signed-off-by: Darrick J. Wong <redacted>
---
 misc/tune2fs.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 4b91192..7299ad6 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -699,6 +699,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);
 }
 
 /*
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help