1 ext4: improve free space calculation for inline_data
3 From: boxi liu <boxi10liu@gmail.com>
5 In ext4 feature inline_data,it use the xattr's space to store the
6 inline data in inode.When we calculate the inline data as the xattr,we
7 add the pad.But in get_max_inline_xattr_value_size() function we count
8 the free space without pad.It cause some contents are moved to a block
12 Signed-off-by: liulei <lewis.liulei@huawei.com>
13 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
14 Reviewed-by: Tao Ma <boyu.mt@taobao.com>
16 fs/ext4/inline.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
19 diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
20 index 33331b4..b8a0746 100644
21 --- a/fs/ext4/inline.c
22 +++ b/fs/ext4/inline.c
23 @@ -72,7 +72,7 @@ static int get_max_inline_xattr_value_size(struct inode *inode,
24 entry = (struct ext4_xattr_entry *)
25 ((void *)raw_inode + EXT4_I(inode)->i_inline_off);
27 - free += le32_to_cpu(entry->e_value_size);
28 + free += EXT4_XATTR_SIZE(le32_to_cpu(entry->e_value_size));