Skip to content

Commit

Permalink
ext4: improve free space calculation for inline_data
Browse files Browse the repository at this point in the history
In ext4 feature inline_data,it use the xattr's space to store the
inline data in inode.When we calculate the inline data as the xattr,we
add the pad.But in get_max_inline_xattr_value_size() function we count
the free space without pad.It cause some contents are moved to a block
even if it can be
stored in the inode.

Signed-off-by: liulei <lewis.liulei@huawei.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Tao Ma <boyu.mt@taobao.com>
  • Loading branch information
boxi liu authored and Theodore Ts'o committed Jul 1, 2013
1 parent e7c96e8 commit c4932db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ext4/inline.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static int get_max_inline_xattr_value_size(struct inode *inode,
entry = (struct ext4_xattr_entry *)
((void *)raw_inode + EXT4_I(inode)->i_inline_off);

free += le32_to_cpu(entry->e_value_size);
free += EXT4_XATTR_SIZE(le32_to_cpu(entry->e_value_size));
goto out;
}

Expand Down

0 comments on commit c4932db

Please sign in to comment.