Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1499056imm; Mon, 3 Sep 2018 01:59:12 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYgcWs3eNADr7/zYPw7a2eduqJ8pruDu0tcbBDREOaOvtrK8Vk+zJJ9GsBrtIuRewQz3+c5 X-Received: by 2002:a63:9f19:: with SMTP id g25-v6mr8236074pge.39.1535965152757; Mon, 03 Sep 2018 01:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535965152; cv=none; d=google.com; s=arc-20160816; b=yoDtXxzSY01UkmjoSaEjVT56X25NT9BdxO79B/pGZgrikgbGUzEtZCAHbNXRSLpElN oTUZwl6nJEMRLx4YA3dXGOkumBinVU1u4DZxUL7+lfV9gojB/XaFuU+EvRnWNjtBF7lH EzxvQiHy7Esla/OAtcdwMbqrVjZrUOL9KoWwHdqPsSNaKxGGZTYkRbTNEe+vhnL9VrKS bzncJSOtEYNnimlYjXZSFNqb54Djo6+CPllpWaXCh+jO8sAiQ3fWABIkuF4RwcmYww/F kMRepFdf0T5Iu6r9YgHw4c1mslcZhluv5ah+aY0LcKMJjfjD0qP/6CDRMSEd4d+oSI4m xzTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=H0hIhOvvtjJeWBgMHymQmJ9zIiBLD+THpYB0X1Wqvdk=; b=KIbDASdzHqdyl+yoop0V9Sz15co9NnRPWgf7CAAWHRPgDP8R3BwE8IctpFrKa3t4d3 aI274AW48SftyxNWSJKYtQa3sdDEqA6Z603aUbax6Yhvyep0/pzqSXWMaYsrOahNRlbh UrFyRDmxSoYSj8dwGGmhAdEBVViR1k2DTEU2uaUgLkMEtin7IOVmFyaLnHYjfftNP+2E sU0G0uSLvNsAmRWnrpW7yAo0bdkmuw2kBPp9evVISfMo/0vuBYBX3zrzXdkrmcLYoOUG ZKVKMr+iwYPlTv5MoY9K1Q/v9b3PSHxnzoLq+ecJ5FQe1xysB2pe1BRW03XUJG00ciPG qqdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l17-v6si16044561pgu.79.2018.09.03.01.58.57; Mon, 03 Sep 2018 01:59:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727393AbeICNRD (ORCPT + 99 others); Mon, 3 Sep 2018 09:17:03 -0400 Received: from mx2.suse.de ([195.135.220.15]:51036 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727093AbeICNRD (ORCPT ); Mon, 3 Sep 2018 09:17:03 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 80C1DAE8E; Mon, 3 Sep 2018 08:57:51 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id C53B81E3609; Mon, 3 Sep 2018 10:57:50 +0200 (CEST) Date: Mon, 3 Sep 2018 10:57:50 +0200 From: Jan Kara To: Chengguang Xu Cc: jack@suse.com, tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, yuchao0@huawei.com, shaggy@kernel.org, hubcap@omnibond.com, martin@omnibond.com, devel@lists.orangefs.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, jfs-discussion@lists.sourceforge.net Subject: Re: [PATCH v2 2/5] ext4: cache NULL when both default_acl and acl are NULL Message-ID: <20180903085750.GD10027@quack2.suse.cz> References: <20180831143352.22970-1-cgxu519@gmx.com> <20180831143352.22970-2-cgxu519@gmx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180831143352.22970-2-cgxu519@gmx.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 31-08-18 22:33:49, Chengguang Xu wrote: > default_acl and acl of newly created inode will be initiated > as ACL_NOT_CACHED in vfs function inode_init_always() and later > will be updated by calling xxx_init_acl() in specific filesystems. > Howerver, when default_acl and acl are NULL then they keep the value ^^^^ However > of ACL_NOT_CACHED, this patch tries to cache NULL for acl/default_acl > in this case. I'd rephrase the above as: ... then they keep the value of ACL_NOT_CACHED. This patch changes the code to cache NULL for acl / default_acl in this case to save unnecessary ACL lookup attempt. Otherwise the patch looks good to me. You can add: Reviewed-by: Jan Kara Honza > > Signed-off-by: Chengguang Xu > --- > v1->v2: > - Coding style change. > > fs/ext4/acl.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c > index fb50f9aa6ead..c1d570ee1d9f 100644 > --- a/fs/ext4/acl.c > +++ b/fs/ext4/acl.c > @@ -284,12 +284,16 @@ ext4_init_acl(handle_t *handle, struct inode *inode, struct inode *dir) > error = __ext4_set_acl(handle, inode, ACL_TYPE_DEFAULT, > default_acl, XATTR_CREATE); > posix_acl_release(default_acl); > + } else { > + inode->i_default_acl = NULL; > } > if (acl) { > if (!error) > error = __ext4_set_acl(handle, inode, ACL_TYPE_ACCESS, > acl, XATTR_CREATE); > posix_acl_release(acl); > + } else { > + inode->i_acl = NULL; > } > return error; > } > -- > 2.17.1 > > -- Jan Kara SUSE Labs, CR