shithub: lwext4

Download patch

ref: ce2df9b216b46fe427f04ee993933c87c180edea
parent: d50817eb368e41137c872ddc02b3653c3209f8d9
author: ngkaho1234 <ngkaho1234@gmail.com>
date: Sat Jan 2 05:30:57 EST 2016

ext4_journal: fix using wrong algorithm on journal checksum v2/v3.

--- a/lwext4/ext4_journal.c
+++ b/lwext4/ext4_journal.c
@@ -187,7 +187,7 @@
 		checksum = ext4_crc32c(EXT4_CRC32_INIT, jbd_fs->sb.uuid,
 				       sizeof(jbd_fs->sb.uuid));
 		/* Calculate crc32c checksum against tho whole block */
-		checksum = ext4_crc32(checksum, bhdr,
+		checksum = ext4_crc32c(checksum, bhdr,
 				block_size);
 		tail->checksum = orig_checksum;
 	}
@@ -247,7 +247,7 @@
 		checksum = ext4_crc32c(EXT4_CRC32_INIT, jbd_fs->sb.uuid,
 				       sizeof(jbd_fs->sb.uuid));
 		/* Calculate crc32c checksum against tho whole block */
-		checksum = ext4_crc32(checksum, header,
+		checksum = ext4_crc32c(checksum, header,
 				block_size);
 
 		header->chksum_type = orig_checksum_type;
@@ -296,7 +296,7 @@
 		checksum = ext4_crc32c(EXT4_CRC32_INIT, jbd_fs->sb.uuid,
 				       sizeof(jbd_fs->sb.uuid));
 		/* Calculate crc32c checksum against tho whole block */
-		checksum = ext4_crc32(checksum, buf,
+		checksum = ext4_crc32c(checksum, buf,
 				block_size);
 	}
 	return checksum;