shithub: lwext4

Download patch

ref: 43da1b2f9a9b6922369cc47e265cac3c93112325
parent: 534f9cba3aa9390d485275431f2165cda34bd876
author: ngkaho1234 <ngkaho1234@gmail.com>
date: Sat Nov 28 11:39:32 EST 2015

ext4_journal: fix block_tag flag being wrongly parsed...

--- a/lwext4/ext4_journal.c
+++ b/lwext4/ext4_journal.c
@@ -211,16 +211,16 @@
 					     JBD_FEATURE_INCOMPAT_64BIT))
 			 *block |= (uint64_t)jbd_get32(tag, blocknr_high) << 32;
 
-		if (jbd_get32(tag, flags) & JBD_FLAG_ESCAPE)
+		if (jbd_get16(tag, flags) & JBD_FLAG_ESCAPE)
 			*block = 0;
 
-		if (!(jbd_get32(tag, flags) & JBD_FLAG_SAME_UUID)) {
+		if (!(jbd_get16(tag, flags) & JBD_FLAG_SAME_UUID)) {
 			uuid_start = (char *)tag + tag_bytes;
 			*uuid_exist = true;
 			memcpy(uuid, uuid_start, UUID_SIZE);
 		}
 
-		if (jbd_get32(tag, flags) & JBD_FLAG_LAST_TAG)
+		if (jbd_get16(tag, flags) & JBD_FLAG_LAST_TAG)
 			*last_tag = true;
 
 	}
@@ -330,7 +330,7 @@
 				       uint32_t *iblock)
 {
 	jbd_iterate_block_table(jbd_fs,
-				header,
+				header + 1,
 				jbd_get32(&jbd_fs->sb, blocksize) -
 					sizeof(struct jbd_bhdr),
 				jbd_display_block_tags,