Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp642510imm; Fri, 31 Aug 2018 09:21:41 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdal3/oRuZg/FBWgvZywVvipo7qcBStgKzley5LjOpB+2xXyXyYKJhJ81a7h+fXhN9IGa+Z6 X-Received: by 2002:a63:25c4:: with SMTP id l187-v6mr7648198pgl.29.1535732501162; Fri, 31 Aug 2018 09:21:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535732501; cv=none; d=google.com; s=arc-20160816; b=sgsWvOHJaVbfxp5PQM7IV6bSxFCqS/D3LBlfjP/07NxjzelW2hdVJV9uBca6QEIeDy 8vh1qlkW/XlE1+YWwJYvniX1U0xD21GG4lhdESsP52/3+77aLPYRaqbOuwpRP0ly9dAX 5c1815F2jPLfnlGMLD6RxYBmx5DCJsf0Iz8gDttaWraXyBVcioYC8bg17Y25Gqb09ZBS +3d8ooL+7hzn2WQCTQfbCRJnwtJSsW/4+fbAvmOPIiMzguNbLKoC8ND05rAlbJx8K8l0 s+mGa7XXe8GbENydTDjpZkXjvJwkrXuHpsCylj5pKCN3at1dWAVnLU1d5Xrg/r7bgbds K1JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=eyYxjMD1+HYQ8S28kuJHrkStHVit7H1+bK4agT3nxGk=; b=MzXgxByKHJ3KZOmAkC5ZJMMwX+x0lsELGsu0fjZdfayDDXLNJ4B3DCEQU0xPVytl2u ul0WzbOAcuJk/0WYbkC/6GycQ+sX+6+l3quODIWLUCGLJ20K5OUQ+JrLgHhp0o6ELSpD 6idGpGmKCNxbTwHK0meZDuOtK6YvwROpWTDkFAIw583OJn6EAhYfn2ZIndgfzIw9FZO1 uYmE6GX9Auz6swVnizrwGXYBSyNhS9Y2Touz+cz4Srx8JdDSQLpyXMARZw8P4xPGDdGJ pcvoHK1wcMYCPtPeK6TGppj2wKIAuG95Hgk2KMHwXI4hqjs/Dh16VxKN/h5M2TBBYZDz 56/A== 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 a140-v6si10922065pfa.61.2018.08.31.09.21.26; Fri, 31 Aug 2018 09:21:41 -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 S1728164AbeHaSmw (ORCPT + 99 others); Fri, 31 Aug 2018 14:42:52 -0400 Received: from mout.gmx.net ([212.227.17.20]:33395 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727430AbeHaSmw (ORCPT ); Fri, 31 Aug 2018 14:42:52 -0400 Received: from localhost.localdomain ([113.87.91.43]) by mail.gmx.com (mrgmx102 [212.227.17.174]) with ESMTPSA (Nemesis) id 0MFz0E-1gAcMO2lEc-00EuCl; Fri, 31 Aug 2018 16:34:43 +0200 From: Chengguang Xu To: 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 Cc: 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, Chengguang Xu Subject: [PATCH v2 3/5] f2fs: cache NULL when both default_acl and acl are NULL Date: Fri, 31 Aug 2018 22:33:50 +0800 Message-Id: <20180831143352.22970-3-cgxu519@gmx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180831143352.22970-1-cgxu519@gmx.com> References: <20180831143352.22970-1-cgxu519@gmx.com> X-Provags-ID: V03:K1:/RhIefOZh0aHUfkOO7kYl866M+kqajmHl/a2nk4GhGQFjF1yikE 6FST6HiQocFxG3mwO0MrtndZVnOroLf0hI0g0TOqXzTYlikSrk4Netk43uoC+EF86O/r9Nm L3qqfKShDqes55tNjJVnGXibEGhbNZ5sSrDDWUacCGpKHsDOih+KrwzqusLK3xzgDvhNCEA 9SYSdHfn5er+98aaF0rvA== X-UI-Out-Filterresults: notjunk:1;V01:K0:OR6dWIJQlQA=:az9MlUgmHuFKt1/DsYiomh nNugJjofuypj//0I2bBCTnequOPLBaKo1X53Npersd7VMd5HLF8o1O3mJNDN6L7Bd3P2eXhrN fya9WDaOFLaHJM/0voSSDBV0ftIPAM4RQKRluOWZmBOlSfiRXkjn/rjFx2swLC0ZX0Q9r99hG zha6UgP6vxVKLqSQffsqBpA29UhrAMDTLhf9AQwX57vEGKQWIWSxxqk0DOqfiOBRkd60i4bXX KVPNkOd1nJ3/q/SEM9ZLHiqz9Mip3gODDS8tvV/OXfiL+n8Jji8hMBxGL00x7q8MT9xLquz78 2WQBggEmNdRlFIoj8TqNITrdUxITjS2ZUXbJDUcHetdFYCS/DHt3sPRZduci+Bw40ZbekyzBJ EH+mYEDdEwQC2Cj4b1Exi0JI9DPPVVd0V8J7ZaIY6ltmhoWOINDTyyR0h7qiJttKX7kHUyI+/ LgCxrcERGERsEyco3TpL4x54Qyr5cyFCp7PqpDrP11Ai4SslPdSEpivBt4yb57NRWCXWL8F+5 9yXllGXExJwY2mOGEoZDIN5voa1Lb+VybxINeZwTQ1BseGzJ/hB/RLdTpcyrsUnwfH7noTNCw NVQ+EYC62snsYwNrmE+ns5ul6tAX21WBZ/zKZVB14tcSZFo8WZz9mUDJi5D7mVlDIgBYRD+mt WyE+ZB/AzaErC7JUQ/dXreeSBFxpX2wtNe/SKmgF976vqOjsS8m2iG6k7MJPfkFN7pHUj2qbO dRyIHbJehW25vHSgin5Fa9BqYfI5mohUfrmuj5B8tekchmOB4pNkz6HMgtY= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 of ACL_NOT_CACHED, this patch tries to cache NULL for acl/default_acl in this case. Signed-off-by: Chengguang Xu --- v1->v2: - Coding style change. fs/f2fs/acl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c index 111824199a88..80aabdf92659 100644 --- a/fs/f2fs/acl.c +++ b/fs/f2fs/acl.c @@ -394,12 +394,16 @@ int f2fs_init_acl(struct inode *inode, struct inode *dir, struct page *ipage, error = __f2fs_set_acl(inode, ACL_TYPE_DEFAULT, default_acl, ipage); posix_acl_release(default_acl); + } else { + inode->i_default_acl = NULL; } if (acl) { if (!error) error = __f2fs_set_acl(inode, ACL_TYPE_ACCESS, acl, ipage); posix_acl_release(acl); + } else { + inode->i_acl = NULL; } return error; -- 2.17.1