Whamcloud - gitweb
libext2fs: don't fail when doing a strict rewrite of inline data
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 14 Mar 2014 13:23:03 +0000 (09:23 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 14 Mar 2014 13:23:08 +0000 (09:23 -0400)
commitcb803fc2caa45fe40f326dcf51f525a56e8af01b
tree81e307fe21c50203320668fe747b52cfa1c44f61
parent81ac00d08a5d011adaa306699b7409477d4e31a3
libext2fs: don't fail when doing a strict rewrite of inline data

ext2fs_inline_data_set() tries to ensure that there is sufficient free
space in the inode to store the inline data.  Unfortunately, it gets
the check wrong -- ext2fs_xattr_inode_max_size() returns the amount of
unused bytes in the EA area, and _data_set() doesn't factor in the
size of the existing inline data.  Therefore, a strict rewrite of an
N-byte inlinedata with another N-byte inlinedata fails.

Fix the code to do the size check correctly.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/inline_data.c