[lustre-devel] [PATCH 36/42] lustre: llite: always enable remote subdir mount

James Simmons jsimmons at infradead.org
Mon Jan 23 15:00:49 PST 2023


From: Lai Siyao <lai.siyao at whamcloud.com>

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 <lai.siyao at whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48535
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 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;
 	}
-- 
2.27.0



More information about the lustre-devel mailing list