shithub: lwext4

Download patch

ref: 1ff612f04d8ea35ad6f9a3feeacd60d93d14c1ad
parent: 398c113aca07017680740caa93a236edcba91f3e
author: ngkaho1234 <[email protected]>
date: Sat Dec 19 13:56:22 EST 2015

ext4_journal: initialize block tag with 0 before writing to it.

--- a/lwext4/ext4_journal.c
+++ b/lwext4/ext4_journal.c
@@ -460,6 +460,7 @@
 	if (JBD_HAS_INCOMPAT_FEATURE(&jbd_fs->sb,
 				     JBD_FEATURE_INCOMPAT_CSUM_V3)) {
 		struct jbd_block_tag3 *tag = __tag;
+		memset(tag, 0, sizeof(struct jbd_block_tag3));
 		jbd_set32(tag, blocknr, tag_info->block);
 		if (JBD_HAS_INCOMPAT_FEATURE(&jbd_fs->sb,
 					     JBD_FEATURE_INCOMPAT_64BIT))
@@ -483,6 +484,7 @@
 
 	} else {
 		struct jbd_block_tag *tag = __tag;
+		memset(tag, 0, sizeof(struct jbd_block_tag));
 		jbd_set32(tag, blocknr, tag_info->block);
 		if (JBD_HAS_INCOMPAT_FEATURE(&jbd_fs->sb,
 					     JBD_FEATURE_INCOMPAT_64BIT))