From patchwork Wed May 31 08:15:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tahsin Erdogan X-Patchwork-Id: 9756169 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9B11C602CC for ; Wed, 31 May 2017 08:17:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D56B2849E for ; Wed, 31 May 2017 08:17:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 822A7284A6; Wed, 31 May 2017 08:17:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30C4C2849E for ; Wed, 31 May 2017 08:17:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751415AbdEaIRS (ORCPT ); Wed, 31 May 2017 04:17:18 -0400 Received: from mail-pf0-f172.google.com ([209.85.192.172]:33793 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751406AbdEaIRQ (ORCPT ); Wed, 31 May 2017 04:17:16 -0400 Received: by mail-pf0-f172.google.com with SMTP id 9so7060754pfj.1 for ; Wed, 31 May 2017 01:17:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1hFwzALBNb5Cnflo/xEVOJ/IGVS1l3OOJOBWyP95mzk=; b=O91m3TKng8OVThHyQ8p02LhFVqJTYZ4QaoKAjnDU/fsxLvXZQSPQakITVAIle08DsM vbcKgLFEyXGxb4e7mIs4eAd5+p9HuCfmkzfWvDQS7X3yQ4IIO/afHqAbWu6zRFOBPO8U MAeITaesr39+hefB3tywQgIG52mLIvrNWxIcLTsJmk5QKlM2A9Jty0yG8skNdtv0N+Kn VUum+fgOqUbN5dfR8GVjkXvhgOIHZZsReyHWXxpTgwAGm6Wa6SluZuhE4hCFX23Gy2yt G7nbe4hhQFoijHJa+od46MsTZ5Qn+5W83dKbVdRH4dKAr42JiuNGac41qSPnPxN13dvf JxgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1hFwzALBNb5Cnflo/xEVOJ/IGVS1l3OOJOBWyP95mzk=; b=Vy7HULTrnJmdFpVl73q+WgM1WrA9pfufLmGeFyN/Hkn99jBb5zDbxx5lth/Hb2fQ2n 2BXosUuRHx73ih1DDz0l21U9MFQRhrCvK/SKM1TV/jzOKgiSK+4UcoIyqtdCJyF4WHYl 3CbtKa7ZqDVn6H+iTSWQZPnbip8BvEwJCrGZhH212ZRJ0/+wPAo2fSd/0WEKB9NecsnJ iPBV5u86K9Se07w5S8+l/QsMWFH9WZcEkTYDGWTFUFt3IIfnDNtrTi9V5FTwHlMPY870 /BnWoWDomR8OgvxzT4dQgVbkEb/pGJBmvLv1vkNex4vPPaioPhQM5EPBiPH/7ZFQ8HCo A5vA== X-Gm-Message-State: AODbwcC/0E1q5D2JBgOW2orR7ODfyyuaoyg1Tmow9oc2RVX2WakJfxey +SKMe30WypwM9r6n X-Received: by 10.98.245.81 with SMTP id n78mr29118512pfh.186.1496218630241; Wed, 31 May 2017 01:17:10 -0700 (PDT) Received: from tahsin1.svl.corp.google.com ([100.123.230.167]) by smtp.gmail.com with ESMTPSA id g75sm25469724pfd.83.2017.05.31.01.17.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 May 2017 01:17:09 -0700 (PDT) From: Tahsin Erdogan To: Jan Kara , Theodore Ts'o , Andreas Dilger , Dave Kleikamp , Alexander Viro , Mark Fasheh , Joel Becker , Jens Axboe , Deepa Dinamani , Mike Christie , Fabian Frederick , linux-ext4@vger.kernel.org Cc: linux-kernel@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, Tahsin Erdogan Subject: [PATCH 17/28] ext4: fix credits calculation for xattr inode Date: Wed, 31 May 2017 01:15:06 -0700 Message-Id: <20170531081517.11438-17-tahsin@google.com> X-Mailer: git-send-email 2.13.0.219.gdb65acc882-goog In-Reply-To: <20170531081517.11438-1-tahsin@google.com> References: <20170531081517.11438-1-tahsin@google.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;