summaryrefslogtreecommitdiff
path: root/fs/ext4
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2014-09-11 15:38:21 (GMT)
committerTheodore Ts'o <tytso@mit.edu>2014-09-11 15:38:21 (GMT)
commitfeb8c6d3dd0f2cc0e1c3376d099cf298c5f2c2c8 (patch)
tree1f91bf01066b1a35414e4f6291fd4ff4ab47a45f /fs/ext4
parentc7f725435adcf2ade4b9152ee33339d28f4cc330 (diff)
downloadlinux-feb8c6d3dd0f2cc0e1c3376d099cf298c5f2c2c8.tar.xz
jbd2: fix journal checksum feature flag handling
Clear all three journal checksum feature flags before turning on whichever journal checksum options we want. Rearrange the error checking so that newer flags get complained about first. Reported-by: TR Reardon <thomas_reardon@hotmail.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/super.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 2766b8e..fb219b9 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3237,6 +3237,10 @@ static int set_journal_csum_feature_set(struct super_block *sb)
incompat = 0;
}
+ jbd2_journal_clear_features(sbi->s_journal,
+ JBD2_FEATURE_COMPAT_CHECKSUM, 0,
+ JBD2_FEATURE_INCOMPAT_CSUM_V3 |
+ JBD2_FEATURE_INCOMPAT_CSUM_V2);
if (test_opt(sb, JOURNAL_ASYNC_COMMIT)) {
ret = jbd2_journal_set_features(sbi->s_journal,
compat, 0,
@@ -3249,11 +3253,8 @@ static int set_journal_csum_feature_set(struct super_block *sb)
jbd2_journal_clear_features(sbi->s_journal, 0, 0,
JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT);
} else {
- jbd2_journal_clear_features(sbi->s_journal,
- JBD2_FEATURE_COMPAT_CHECKSUM, 0,
- JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT |
- JBD2_FEATURE_INCOMPAT_CSUM_V3 |
- JBD2_FEATURE_INCOMPAT_CSUM_V2);
+ jbd2_journal_clear_features(sbi->s_journal, 0, 0,
+ JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT);
}
return ret;