Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp642584imm; Fri, 31 Aug 2018 09:21:47 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb8yIkJnBTTXJ5z1L2WozmrepO3t3hcrDPheQdr6XRLJsBy97CCAApfYHax4uKffTPwJPpm X-Received: by 2002:a62:3a08:: with SMTP id h8-v6mr16560576pfa.61.1535732507139; Fri, 31 Aug 2018 09:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535732507; cv=none; d=google.com; s=arc-20160816; b=VbB/dTOemRUHZfJOnOel+MUB8vaZa7qkX6qv5dP/GXOinBtMdgnC6BCRR/kULI5Q4v 38Lv7/JxOF8wBKoNMW4e4/8ZktjtiYTeKREHGhMZUUIKeLfRXy1l1qRd5uQhgMYEZZYg e0pWlazNPYfMzB8K5tz2OuLennBcyXaQLah5ybjnMBZ6MKkv2ShwdMWvWS4DOxb9oWuJ 95p9+rVT/0gwpYrBA6e7pFnJRkDpQ0yMXC8YSNqGMj2kZO4ik7oiHzIpjp7lq4k4mtK1 +BcOm1OHkqOYZKpnCLlxViUy12LkfbzYfK4KyDv1U97ya7VjFID9Wpnp/2JkM49i8QXc xA8Q== 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=hegOBtfsPLYnVt2q7qcsyADNtANI6se3WrxyHzDQ2R0=; b=o2A+XFrwcJzhPNxrNOGcMlIIPxCIDlw/+T6NWybAV1y5u7Bxzu5mvqDZgVlJ79LrNC P80l71x9hECAYKUuWW0IyNMEpjYvIwHxAs/GogfXmCxIaBmfW/8MtRlAYYrJ37KKbYry 5vpWGm5Ugeij++1ttNUhBvUgf2zdC61UC4RI09DnfiosdOZKQ2jTRraHmsLvnFhMvXUu cYtCmIRYH7AOARjI98PwB1bb28kinGvjvVH+Hd5S5j3oVwl/VVD4vc9Is166YEm7AYd/ 1Z3A/8CTDofJ4I5KK4K45I29lN3uFZ1WH6if2XmKK1VG/+vCdYGvAprqawj99ebeyJge guOA== 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 p13-v6si10273771pgi.317.2018.08.31.09.21.32; Fri, 31 Aug 2018 09:21:47 -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 S1728241AbeHaSnB (ORCPT + 99 others); Fri, 31 Aug 2018 14:43:01 -0400 Received: from mout.gmx.net ([212.227.17.22]:35483 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727430AbeHaSnB (ORCPT ); Fri, 31 Aug 2018 14:43:01 -0400 Received: from localhost.localdomain ([113.87.91.43]) by mail.gmx.com (mrgmx102 [212.227.17.174]) with ESMTPSA (Nemesis) id 0Lm6IP-1fMPpD2kBl-00Zbyi; Fri, 31 Aug 2018 16:34:51 +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 4/5] jfs: cache NULL when both default_acl and acl are NULL Date: Fri, 31 Aug 2018 22:33:51 +0800 Message-Id: <20180831143352.22970-4-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:d9aJYmZgvM9aGdD5VTaWAHOHVZIrp6b9beQG8hwubkJPXUUJFnX TFuaJ2rexYmgfriQJskD3lhUBbemZQEJCXh7Mue2sNXhyCEDT6JqQw+vCd6YKZMYWnX5Rtd C0rQ+A++QtokeBrtu5hmVQTw73Ue1X2yWBL5KdJwf6uOrPZTKQ5vG9fTe/siQSdGGDWMkYC 2j7tJutR28N/tr4wWcswg== X-UI-Out-Filterresults: notjunk:1;V01:K0:3IIO8lkx4pk=:htnvixdrZjP0wM2z2Ot9XI UDFczgEHAkig7fi20exlEoT2+jyIqQTnAyn7Bsa2gF2e4ODAKiQrY22vTSzs6W0los3+p02l1 IgFJyde7HaBS3sjJGv1Cci+ZLAvLqKqPPezGtuIN5FN4H8kpDvH+xYj2iZNYKPKxMYC9PlYOn QDoafAuQPrlKTObO6/3AuOnphmnrtTPyyxKiyHbVdyasnM0809DddzDQPGmSUiRSMN05X8Bez qlAuFPbpqoTntgdLhux3UkfT4VTINY4eyvYgS8seCWwhb5pRxztnRJHNTr9u2nPvCOF+cE/Cy rI1E28lJgdGbVOvIX+SmLGtsh1Yyswi9MS8GbNfaf8nxUY0SyHGxD7PVYPuxpOXI0rTUCYC2C D+5DTddNK/cjWHrEcgcXXCllVEFCcJo3kjZT2bS+L5rYDs70CGg3VFpUAUHFLYP5vUYV+KOcU ct7ib4gfdAExd9f5R9VcnEyZpbueKvCmoxzle9zAcEcoln2kTUOLTcD6ZePuuK97XdKuhj2LG l14sOo/70D/q3w//TKNlHDLy16RYzERPfdNR1+yHffMnG+U48lulwmTW6eoPb7raljRO5GsqF 01xL4hp2N1DBTbcgIhYPUItdCt4B9VTqY3n6hRL9pn3NX+rUuoqh3jvZ/Eavunrl5iJ03Wjws fVZydnTYVn/h1L9tYdyZRMl6f+gRLVD4fU/mkx5IPjdZ3TjUXMPKUtHiyvfsua/TDxx15pa+w giGbSUsMPaFuPcbfIcpUZ/MR0MKB6zono9RyO+4dAU9gBVeTpFs5cKzJY40= 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/jfs/acl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c index 2e71b6e7e646..8c06a6ea862d 100644 --- a/fs/jfs/acl.c +++ b/fs/jfs/acl.c @@ -146,12 +146,16 @@ int jfs_init_acl(tid_t tid, struct inode *inode, struct inode *dir) if (default_acl) { rc = __jfs_set_acl(tid, inode, ACL_TYPE_DEFAULT, default_acl); posix_acl_release(default_acl); + } else { + inode->i_default_acl = NULL; } if (acl) { if (!rc) rc = __jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, acl); posix_acl_release(acl); + } else { + inode->i_acl = NULL; } JFS_IP(inode)->mode2 = (JFS_IP(inode)->mode2 & 0xffff0000) | -- 2.17.1