diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2015-10-17 16:16:02 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2015-10-17 16:16:02 -0400 |
commit | 8c81bd8f586c46eaf114758a78d82895a2b081c2 (patch) | |
tree | f23c8117906fa29aa0ad3890dd5a2faa8d8ed811 /fs/ext4/super.c | |
parent | 8b4953e13f4c5d9a3c869f5fca7d51e1700e7db0 (diff) | |
download | linux-8c81bd8f586c46eaf114758a78d82895a2b081c2.tar.gz linux-8c81bd8f586c46eaf114758a78d82895a2b081c2.tar.bz2 linux-8c81bd8f586c46eaf114758a78d82895a2b081c2.zip |
ext4: store checksum seed in superblock
Allow the filesystem to store the metadata checksum seed in the
superblock and add an incompat feature to say that we're using it.
This enables tune2fs to change the UUID on a mounted metadata_csum
FS without having to (racy!) rewrite all disk metadata.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 7ef3fa58d3fe..43c0cc802189 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3196,7 +3196,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) } /* Precompute checksum seed for all metadata */ - if (ext4_has_metadata_csum(sb)) + if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_CSUM_SEED)) + sbi->s_csum_seed = le32_to_cpu(es->s_checksum_seed); + else if (ext4_has_metadata_csum(sb)) sbi->s_csum_seed = ext4_chksum(sbi, ~0, es->s_uuid, sizeof(es->s_uuid)); |