add patch add-nombcache-mount-option
[ext4-patch-queue.git] / fix-credits-calculation-for-xattr-inode
blob4a9e59606745dcd9545cf59eabfc328d7aa6b22e
1 ext4: fix credits calculation for xattr inode
3 From: Tahsin Erdogan <tahsin@google.com>
5 When there is no space for a value in xattr block, it may be stored
6 in an xattr inode even if the value length is less than
7 EXT4_XATTR_MIN_LARGE_EA_SIZE(). So the current assumption in credits
8 calculation is wrong.
10 Signed-off-by: Tahsin Erdogan <tahsin@google.com>
11 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 ---
13  fs/ext4/xattr.c | 3 +--
14  1 file changed, 1 insertion(+), 2 deletions(-)
16 diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
17 index 739f73a5a345..dcf7ec98f138 100644
18 --- a/fs/ext4/xattr.c
19 +++ b/fs/ext4/xattr.c
20 @@ -1590,8 +1590,7 @@ ext4_xattr_set(struct inode *inode, int name_index, const char *name,
21         if (error)
22                 return error;
24 -       if ((value_len >= EXT4_XATTR_MIN_LARGE_EA_SIZE(sb->s_blocksize)) &&
25 -           ext4_has_feature_ea_inode(sb)) {
26 +       if (ext4_has_feature_ea_inode(sb)) {
27                 int nrblocks = (value_len + sb->s_blocksize - 1) >>
28                                         sb->s_blocksize_bits;
30 -- 
31 2.13.1.611.g7e3b11ae1-goog