ref: d1f4f6d1631975e7d01ef8d471188f3a8d26e93d
parent: c5f8d135cf3555404f1c4df5617f94f4fc2bac87
author: Fangrui Song <[email protected]>
date: Sat Nov 17 17:39:12 EST 2018
Fix jbd_commit_header::chksum_{type,size}
--- a/src/ext4_journal.c
+++ b/src/ext4_journal.c
@@ -267,9 +267,9 @@
uint32_t checksum = 0;
if (jbd_has_csum(&jbd_fs->sb)) {
- uint32_t orig_checksum_type = header->chksum_type,
- orig_checksum_size = header->chksum_size,
- orig_checksum = header->chksum[0];
+ uint8_t orig_checksum_type = header->chksum_type,
+ orig_checksum_size = header->chksum_size;
+ uint32_t orig_checksum = header->chksum[0];
uint32_t block_size = jbd_get32(&jbd_fs->sb, blocksize);
header->chksum_type = 0;
header->chksum_size = 0;
@@ -1788,8 +1788,8 @@
if (JBD_HAS_INCOMPAT_FEATURE(&journal->jbd_fs->sb,
JBD_FEATURE_COMPAT_CHECKSUM)) {
- jbd_set32(header, chksum_type, JBD_CRC32_CHKSUM);
- jbd_set32(header, chksum_size, JBD_CRC32_CHKSUM_SIZE);
+ header->chksum_type = JBD_CRC32_CHKSUM;
+ header->chksum_size = JBD_CRC32_CHKSUM_SIZE;
jbd_set32(header, chksum[0], trans->data_csum);
}
jbd_commit_csum_set(journal->jbd_fs, header);