shithub: lwext4

Download patch

ref: 6176f0aa46bc28e6f20626c71cceed3408684e5e
parent: e4339496535732641e59343d807e9e436134a980
parent: d1f4f6d1631975e7d01ef8d471188f3a8d26e93d
author: Grzegorz Kostka <kostka.grzegorz@gmail.com>
date: Sun Dec 2 21:34:40 EST 2018

Merge pull request #47 from MaskRay/jbd_commit_header

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);