Whamcloud - gitweb
LU-16667 build: fix extra errors related to struct mnt_idmap
authorJian Yu <yujian@whamcloud.com>
Thu, 2 Nov 2023 18:54:42 +0000 (11:54 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Sun, 5 Nov 2023 10:45:24 +0000 (10:45 +0000)
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>
lustre/llite/pcc.c

index 2bdd8b3..3a7cd62 100644 (file)
@@ -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;