From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752703AbdFUVWU (ORCPT ); Wed, 21 Jun 2017 17:22:20 -0400 Received: from mail-pg0-f51.google.com ([74.125.83.51]:34545 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751154AbdFUVWS (ORCPT ); Wed, 21 Jun 2017 17:22:18 -0400 From: Tahsin Erdogan To: Andreas Dilger , "Darrick J . Wong" , Jan Kara , "Theodore Ts'o" , linux-ext4@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Tahsin Erdogan Subject: [PATCH 17/32] ext4: fix credits calculation for xattr inode Date: Wed, 21 Jun 2017 14:21:27 -0700 Message-Id: <20170621212142.16581-17-tahsin@google.com> X-Mailer: git-send-email 2.13.1.611.g7e3b11ae1-goog In-Reply-To: <20170621212142.16581-1-tahsin@google.com> References: <20170621212142.16581-1-tahsin@google.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- fs/ext4/xattr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 739f73a5a345..dcf7ec98f138 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -1590,8 +1590,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; -- 2.13.1.611.g7e3b11ae1-goog