From b3155298910c64a312620309f320d26e9461eb19 Mon Sep 17 00:00:00 2001 From: Tahsin Erdogan Date: Wed, 21 Jun 2017 22:16:20 -0400 Subject: ext4: fix credits calculation for xattr inode When there is no space for a value in xattr block, it may be stored in an xattr inode even if the value length is less than EXT4_XATTR_MIN_LARGE_EA_SIZE(). So the current assumption in credits calculation is wrong. Signed-off-by: Tahsin Erdogan Signed-off-by: Theodore Ts'o --- fs/ext4/xattr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'fs') diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index ed27b5241e69..9932254c3de9 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -1588,8 +1588,7 @@ ext4_xattr_set(struct inode *inode, int name_index, const char *name, if (error) return error; - if ((value_len >= EXT4_XATTR_MIN_LARGE_EA_SIZE(sb->s_blocksize)) && - ext4_has_feature_ea_inode(sb)) { + if (ext4_has_feature_ea_inode(sb)) { int nrblocks = (value_len + sb->s_blocksize - 1) >> sb->s_blocksize_bits; -- cgit v1.2.3