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 <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/52955
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
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));
}
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;