diff options
Diffstat (limited to 'fs/jbd2/recovery.c')
-rw-r--r-- | fs/jbd2/recovery.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c index 626846bac32f..d4851464b57e 100644 --- a/fs/jbd2/recovery.c +++ b/fs/jbd2/recovery.c | |||
@@ -399,18 +399,17 @@ static int jbd2_commit_block_csum_verify(journal_t *j, void *buf) | |||
399 | static int jbd2_block_tag_csum_verify(journal_t *j, journal_block_tag_t *tag, | 399 | static int jbd2_block_tag_csum_verify(journal_t *j, journal_block_tag_t *tag, |
400 | void *buf, __u32 sequence) | 400 | void *buf, __u32 sequence) |
401 | { | 401 | { |
402 | __u32 provided, calculated; | 402 | __u32 csum32; |
403 | 403 | ||
404 | if (!JBD2_HAS_INCOMPAT_FEATURE(j, JBD2_FEATURE_INCOMPAT_CSUM_V2)) | 404 | if (!JBD2_HAS_INCOMPAT_FEATURE(j, JBD2_FEATURE_INCOMPAT_CSUM_V2)) |
405 | return 1; | 405 | return 1; |
406 | 406 | ||
407 | sequence = cpu_to_be32(sequence); | 407 | sequence = cpu_to_be32(sequence); |
408 | calculated = jbd2_chksum(j, j->j_csum_seed, (__u8 *)&sequence, | 408 | csum32 = jbd2_chksum(j, j->j_csum_seed, (__u8 *)&sequence, |
409 | sizeof(sequence)); | 409 | sizeof(sequence)); |
410 | calculated = jbd2_chksum(j, calculated, buf, j->j_blocksize); | 410 | csum32 = jbd2_chksum(j, csum32, buf, j->j_blocksize); |
411 | provided = be32_to_cpu(tag->t_checksum); | ||
412 | 411 | ||
413 | return provided == cpu_to_be32(calculated); | 412 | return tag->t_checksum == cpu_to_be16(csum32); |
414 | } | 413 | } |
415 | 414 | ||
416 | static int do_one_pass(journal_t *journal, | 415 | static int do_one_pass(journal_t *journal, |