summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lwext4/ext4_fs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lwext4/ext4_fs.c b/lwext4/ext4_fs.c
index 3cbce8f..c1bc25f 100644
--- a/lwext4/ext4_fs.c
+++ b/lwext4/ext4_fs.c
@@ -700,6 +700,12 @@ static uint32_t ext4_fs_inode_checksum(struct ext4_inode_ref *inode_ref)
inode_size);
ext4_inode_set_checksum(sb, inode_ref->inode,
orig_checksum);
+
+ /* If inode size is not large enough to hold the
+ * upper 16bit of the checksum */
+ if (inode_size == EXT4_GOOD_OLD_INODE_SIZE)
+ checksum &= 0xFFFF;
+
}
return checksum;
}