ref: 48d955206bccfd6d4fe25ad0934765428fe7fda2
parent: 4d530fc1bbb24770246a83beb161a4b9d394f817
author: Kaho Ng <ngkaho1234@gmail.com>
date: Mon Feb 27 19:05:12 EST 2017
ext4_inode: deal with i_extra_isize depending on inode size
--- a/src/ext4_inode.c
+++ b/src/ext4_inode.c
@@ -273,7 +273,8 @@
uint16_t ext4_inode_get_extra_isize(struct ext4_sblock *sb,
struct ext4_inode *inode)
{
- if (ext4_sb_feature_ro_com(sb, EXT4_FRO_COM_EXTRA_ISIZE))
+ uint16_t inode_size = ext4_get16(sb, inode_size);
+ if (inode_size > EXT4_GOOD_OLD_INODE_SIZE)
return to_le16(inode->extra_isize);
else
return 0;
@@ -283,7 +284,8 @@
struct ext4_inode *inode,
uint16_t size)
{
- if (ext4_sb_feature_ro_com(sb, EXT4_FRO_COM_EXTRA_ISIZE))
+ uint16_t inode_size = ext4_get16(sb, inode_size);
+ if (inode_size > EXT4_GOOD_OLD_INODE_SIZE)
inode->extra_isize = to_le16(size);
}