From patchwork Mon Jan 23 23:00:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 13113181 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from pdx1-mailman-customer002.dreamhost.com (listserver-buz.dreamhost.com [69.163.136.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A89DCC05027 for ; Mon, 23 Jan 2023 23:35:02 +0000 (UTC) Received: from pdx1-mailman-customer002.dreamhost.com (localhost [127.0.0.1]) by pdx1-mailman-customer002.dreamhost.com (Postfix) with ESMTP id 4P15S517Lxz22XM; Mon, 23 Jan 2023 15:10:45 -0800 (PST) Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pdx1-mailman-customer002.dreamhost.com (Postfix) with ESMTPS id 4P15Qv627Qz22W5 for ; Mon, 23 Jan 2023 15:09:43 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id A7152E1E; Mon, 23 Jan 2023 18:00:58 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id A4BED5898C; Mon, 23 Jan 2023 18:00:58 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Mon, 23 Jan 2023 18:00:49 -0500 Message-Id: <1674514855-15399-37-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1674514855-15399-1-git-send-email-jsimmons@infradead.org> References: <1674514855-15399-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 36/42] lustre: llite: always enable remote subdir mount X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.39 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lai Siyao , Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Lai Siyao For historical reason, ROOT is revalidated with IT_LOOKUP in .permission to ensure permission is update to date because ROOT is never looked up. But ROOT FID and layout is not changeable, it's PERM lock that should be revalidated, i.e., revalidate with IT_GETATTR instead of IT_LOOKUP. Since PERM|UPDATE lock is on the MDT where object is located, client can cache this lock, therefore remote subdir mount doesn't need to lookup ROOT in each file access. WC-bug-id: https://jira.whamcloud.com/browse/LU-16026 Lustre-commit: 6f490275b0e0455a4 ("LU-16026 llite: always enable remote subdir mount") Signed-off-by: Lai Siyao Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48535 Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/llite/file.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/lustre/llite/file.c b/fs/lustre/llite/file.c index e343fc83d707..aa9c5daadcac 100644 --- a/fs/lustre/llite/file.c +++ b/fs/lustre/llite/file.c @@ -5527,11 +5527,10 @@ int ll_inode_permission(struct inode *inode, int mask) return -ECHILD; /* as root inode are NOT getting validated in lookup operation, - * need to do it before permission check. + * need to revalidate PERM before permission check. */ - if (is_root_inode(inode)) { - rc = ll_inode_revalidate(inode->i_sb->s_root, IT_LOOKUP); + rc = ll_inode_revalidate(inode->i_sb->s_root, IT_GETATTR); if (rc) return rc; }