aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd2
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2014-09-11 11:38:21 -0400
committerTheodore Ts'o <tytso@mit.edu>2014-09-11 11:38:21 -0400
commitfeb8c6d3dd0f2cc0e1c3376d099cf298c5f2c2c8 (patch)
tree1f91bf01066b1a35414e4f6291fd4ff4ab47a45f /fs/jbd2
parentc7f725435adcf2ade4b9152ee33339d28f4cc330 (diff)
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/jbd2')
-rw-r--r--fs/jbd2/journal.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 415041c4c40c..e4dc74713a43 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -1522,14 +1522,6 @@ static int journal_get_superblock(journal_t *journal)
1522 goto out; 1522 goto out;
1523 } 1523 }
1524 1524
1525 if (jbd2_journal_has_csum_v2or3(journal) &&
1526 JBD2_HAS_COMPAT_FEATURE(journal, JBD2_FEATURE_COMPAT_CHECKSUM)) {
1527 /* Can't have checksum v1 and v2 on at the same time! */
1528 printk(KERN_ERR "JBD2: Can't enable checksumming v1 and v2 "
1529 "at the same time!\n");
1530 goto out;
1531 }
1532
1533 if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_CSUM_V2) && 1525 if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_CSUM_V2) &&
1534 JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_CSUM_V3)) { 1526 JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_CSUM_V3)) {
1535 /* Can't have checksum v2 and v3 at the same time! */ 1527 /* Can't have checksum v2 and v3 at the same time! */
@@ -1538,6 +1530,14 @@ static int journal_get_superblock(journal_t *journal)
1538 goto out; 1530 goto out;
1539 } 1531 }
1540 1532
1533 if (jbd2_journal_has_csum_v2or3(journal) &&
1534 JBD2_HAS_COMPAT_FEATURE(journal, JBD2_FEATURE_COMPAT_CHECKSUM)) {
1535 /* Can't have checksum v1 and v2 on at the same time! */
1536 printk(KERN_ERR "JBD2: Can't enable checksumming v1 and v2/3 "
1537 "at the same time!\n");
1538 goto out;
1539 }
1540
1541 if (!jbd2_verify_csum_type(journal, sb)) { 1541 if (!jbd2_verify_csum_type(journal, sb)) {
1542 printk(KERN_ERR "JBD2: Unknown checksum type\n"); 1542 printk(KERN_ERR "JBD2: Unknown checksum type\n");
1543 goto out; 1543 goto out;