Whamcloud - gitweb
LU-17674 build: use nop_mnt_idmap in inode_owner_or_capable 72/54572/6
authorQian Yingjin <qian@ddn.com>
Tue, 26 Mar 2024 08:37:16 +0000 (04:37 -0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 8 Apr 2024 15:36:19 +0000 (15:36 +0000)
The build on kernel 6.7 reported the following errors:

     if (!inode_owner_or_capable(&init_user_ns, inode))
                                 ^~~~~~~~~~~~~
     note: expected 'struct mnt_idmap *' but argument is of
     type 'struct user_namespace *'

It replaces &init_user_ns with "nop_mnt_idmap" to fix the build
failure on new kernel.

Test-Parameters: trivial
Fixes: ce98bfe5f72 ("LU-10499 pcc: add readonly mode for PCC")
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: I758ef5a074bb6449b2d703865010974d5135f241
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54572
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/llite/file.c

index 6260687..668b870 100644 (file)
@@ -4757,7 +4757,7 @@ out_ladvise:
                if (!S_ISREG(inode->i_mode))
                        RETURN(-EINVAL);
 
-               if (!inode_owner_or_capable(&init_user_ns, inode))
+               if (!inode_owner_or_capable(&nop_mnt_idmap, inode))
                        RETURN(-EPERM);
 
                OBD_ALLOC_PTR(attach);