From 89f62f7c1d3b972e9eb4aaf4959a97fa5254f77d Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Thu, 2 Nov 2023 11:54:42 -0700 Subject: [PATCH] LU-16667 build: fix extra errors related to struct mnt_idmap This patch fixes the following extra build errors related to struct mnt_idmap: lustre/llite/pcc.c:2440:40: error: passing argument 1 of 'inode_owner_or_capable' from incompatible pointer type [-Werror=incompatible-pointer-types] 2440 | inode_owner_or_capable(&init_user_ns, inode)) || | ^~~~~~~~~~~~~ | | | struct user_namespace * include/linux/fs.h:1624:47: note: expected 'struct mnt_idmap *' but argument is of type 'struct user_namespace *' 1624 | bool inode_owner_or_capable(struct mnt_idmap *idmap, | ~~~~~~~~~~~~~~~~~~^~~~~ lustre/llite/pcc.c:3656:40: error: passing argument 1 of 'inode->i_op->fileattr_set' from incompatible pointer type [-Werror=incompatible-pointer-types] 3656 | rc = inode->i_op->fileattr_set(&init_user_ns, dentry, &fa); | ^~~~~~~~~~~~~ | | | struct user_namespace * lustre/llite/pcc.c:3656:40: note: expected 'struct mnt_idmap *' but argument is of type 'struct user_namespace *' Change-Id: Ia310f6f9053228b38b41243912dfe7818cfef33a Test-Parameters: trivial Fixes: 3011aa5 ("LU-16667 build: struct mnt_idmap, linux/filelock.h") Signed-off-by: Jian Yu Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/52955 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/llite/pcc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/llite/pcc.c b/lustre/llite/pcc.c index 2bdd8b3..3a7cd62 100644 --- a/lustre/llite/pcc.c +++ b/lustre/llite/pcc.c @@ -2437,7 +2437,7 @@ bool pcc_inode_permission(struct inode *inode) umode_t mask = inode->i_mode & ll_i2pccs(inode)->pccs_mode; return (mask & (S_IRUSR | S_IXUSR) && - inode_owner_or_capable(&init_user_ns, inode)) || + inode_owner_or_capable(&nop_mnt_idmap, inode)) || (mask & (S_IRGRP | S_IXGRP) && in_group_p(inode->i_gid)) || (mask & (S_IROTH | S_IXOTH)); } @@ -3653,7 +3653,7 @@ int pcc_file_reset_projid(struct pcc_dataset *dataset, struct file *file, RETURN(0); } - rc = inode->i_op->fileattr_set(&init_user_ns, dentry, &fa); + rc = inode->i_op->fileattr_set(&nop_mnt_idmap, dentry, &fa); #else struct fsxattr fsx = { .fsx_projid = projid }; mm_segment_t old_fs; -- 1.8.3.1