aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTahsin Erdogan <tahsin@google.com>2017-06-21 22:16:20 -0400
committerTheodore Ts'o <tytso@mit.edu>2017-06-21 22:16:20 -0400
commitb3155298910c64a312620309f320d26e9461eb19 (patch)
treef2c87dc74547f0ddc91416239f482353c93dfe1a
parent7cec191894e4e2200d942415c3ebccb146214d26 (diff)
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 <tahsin@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--fs/ext4/xattr.c3
1 files changed, 1 insertions, 2 deletions
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,
1588 if (error) 1588 if (error)
1589 return error; 1589 return error;
1590 1590
1591 if ((value_len >= EXT4_XATTR_MIN_LARGE_EA_SIZE(sb->s_blocksize)) && 1591 if (ext4_has_feature_ea_inode(sb)) {
1592 ext4_has_feature_ea_inode(sb)) {
1593 int nrblocks = (value_len + sb->s_blocksize - 1) >> 1592 int nrblocks = (value_len + sb->s_blocksize - 1) >>
1594 sb->s_blocksize_bits; 1593 sb->s_blocksize_bits;
1595 1594