Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp567625imm; Fri, 31 Aug 2018 07:40:29 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYmujFW+cRhH/YBcSDVoteeZUW4xBmKwLqa8+b0EJa9EJbdUTJl7fbXR5WAMGB1WzczdMi7 X-Received: by 2002:a17:902:290a:: with SMTP id g10-v6mr15774741plb.110.1535726429813; Fri, 31 Aug 2018 07:40:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535726429; cv=none; d=google.com; s=arc-20160816; b=vtnbkMLe+Oc0L3CGpcLCn8IQKTljLxdo1G4b5G2KCMWTgCh5bIcC6FUiXNz9QdKvYn YMy99NEi4LY1AH7JtwplEzjEPgAcnJJXt7ux/nF+BUGolkxAyQk+55EPPjT0wlTmBV46 PY/Zj4rw8D2GugWlAmWWvcRV12D9mnrhRvfs3t8tzxoZ47Vh27YNk5vVdA6QM+NtexPN RGx6rkr7lY/oY0FbxeFHqIwf16ZlRuAzttmcJ7VX9QNRCqmNXg4samhSfaTTJ0E0Drvb BFb/fnlT85k2j3CzujBhd6LVyUZoVUJdFKTGkoEFy/X7w7I6bQSrTObFIuf3IVcvUdQJ cYyA== 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=L1djWuwH6aqR2HbNLzgKx9GohxuoG4trjjC+xAeTYFs=; b=lUVm9mF/EbYZH/Jjgv5vcgrGdGamuuqC7GxGPO1yGNP5OxB9Ln9dSMjLA6PENURTyH gMcf8tD48FPGAxrfl3E/+Ki5kD8pQJ0e7ZJcUKDz0sDsr6G3mJoyH2qYRvtvCfW20GYw qVT8WnV3BxSKWnTudJzqmiKk9BPPGjLqg5ffw6USfzpIUc6vQMP1j88adHEJLFFSvuYy nQWoFr3km1flaEfOvyJuMl7veuXq77xpkgD8VjQGgx21QB9siWoHQKgOtQ35rW+ELAAV HZvLb5AaMLdAlvbdAMlSLdrXxlq2ZEl8MoihliK05Zs+XNgR0vHEfaH0FyVOM/jfdO+7 wa0Q== 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 u186-v6si9996689pfu.263.2018.08.31.07.40.14; Fri, 31 Aug 2018 07:40:29 -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 S1728436AbeHaSnK (ORCPT + 99 others); Fri, 31 Aug 2018 14:43:10 -0400 Received: from mout.gmx.net ([212.227.17.22]:50685 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727430AbeHaSnK (ORCPT ); Fri, 31 Aug 2018 14:43:10 -0400 Received: from localhost.localdomain ([113.87.91.43]) by mail.gmx.com (mrgmx102 [212.227.17.174]) with ESMTPSA (Nemesis) id 0MDW9x-1g7bYM0HjJ-00Gq9E; Fri, 31 Aug 2018 16:35:00 +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 5/5] orangefs: cache NULL when both default_acl and acl are NULL Date: Fri, 31 Aug 2018 22:33:52 +0800 Message-Id: <20180831143352.22970-5-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:uxNQ/XKf2YUz8pgu6glf5JPalPJH5RB8lUUceXOg8ov+qMxkd+/ p6w5/vuj2q15inLVZBnnYAQLHib/osoBfIhr/ZXmsMZnDbUxuJDNmBnpTph6JMqc2DUsqlG yXrN+qGcm66+TnAJE8i9hn4xERkOJetHBmu5eMeBKssFuVvVaxVu/lK7Eo6QUEChoS/eOX1 Tdzht8mI1z53FHf20IlVQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:4T70T1yxekw=:j6h4KUq6vJXHgnu+rV1KeK WApSWJxPfhyh/9+kO16rka9uJEarbyllSKMlR2bG6vthxg7jA0rOClicEIKHczO+tV6WWIl+F QgkqnbRzvQVLCr688sKr7RVqOJw6WyKrFw7IVx0usFf0jSkJS00F+/ZZHEYmxlum2VOqbsB79 louEBzxOokGPRcrskgYppjQ6wRJBOytDqKxAfu4dWxUdDPy0ZPjPlHQXMJBXT2HbmlQ1SSacO VS+EjMNZ9T9Un3cPshLC/DfFb6V/G9lfpJ1F0Bwho6kPDL3sXMIVN3TLogZeVrQfTH/Szi/oH eH4w5HQ9zKJshJZ+coUYb+12e7HJZdLP36fsTIqhg98jjbiAYVOuaizI9ppzVAxOvo7CGhT9e +tfm+DPCH/d9/yOoa7QGah191Ygtws4InIxm/Bz6l1mLGBuWVMxbtiaCXucwcWrkolZW2Kn+N d07MChpNjtWYjMxqvIa3TxmmObGg8lCaqrcMXGTWnZlT50z1IzILwrR0ZKPjrnAPTI1z2hQNi 2AVbYROtSOakpscGLLAn5IbXOeFZO26FKtDl+zU45HeAtGAHlyKDHplOLBRknOk3W0x8TEAbQ BiyiADId1bRsdPNoCAoL16VsUzGcw+8rDHjIZCMlEWxtHBHy9w2hszd+yL1qg3Sh+rjAvXqZ9 IusTVs5H5zxWASzQwdu1m6P9Oc8ObP3XWXgP5oOOypmMcBxFGi4Ll/Sz3ZhtG9YcEW+P4KrQW jA4g5/1DBmrzHV5kDy6lYGqKuugvaBaegUad7w/YvFGHso1ysA8/Q1xSqXI= 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/orangefs/acl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/orangefs/acl.c b/fs/orangefs/acl.c index 10587413b20e..72d2ff17d27b 100644 --- a/fs/orangefs/acl.c +++ b/fs/orangefs/acl.c @@ -167,12 +167,16 @@ int orangefs_init_acl(struct inode *inode, struct inode *dir) error = __orangefs_set_acl(inode, default_acl, ACL_TYPE_DEFAULT); posix_acl_release(default_acl); + } else { + inode->i_default_acl = NULL; } if (acl) { if (!error) error = __orangefs_set_acl(inode, acl, ACL_TYPE_ACCESS); posix_acl_release(acl); + } else { + inode->i_acl = NULL; } /* If mode of the inode was changed, then do a forcible ->setattr */ -- 2.17.1