diff options
author | Coleman Kane <[email protected]> | 2021-03-20 00:00:59 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-19 21:00:59 -0700 |
commit | e2a8296131e94ad785f5564156ed2db1fdb2e080 (patch) | |
tree | a06b88b9027c0d410c34bfc9691e89e0a212e2a6 /config/kernel-is_owner_or_cap.m4 | |
parent | 330c6c052314b530e5b271bc731d4040570c5fb0 (diff) |
Linux 5.12 compat: idmapped mounts
In Linux 5.12, the filesystem API was modified to support ipmapped
mounts by adding a "struct user_namespace *" parameter to a number
functions and VFS handlers. This change adds the needed autoconf
macros to detect the new interfaces and updates the code appropriately.
This change does not add support for idmapped mounts, instead it
preserves the existing behavior by passing the initial user namespace
where needed. A subsequent commit will be required to add support
for idmapped mounted.
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Co-authored-by: Brian Behlendorf <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes #11712
Diffstat (limited to 'config/kernel-is_owner_or_cap.m4')
-rw-r--r-- | config/kernel-is_owner_or_cap.m4 | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/config/kernel-is_owner_or_cap.m4 b/config/kernel-is_owner_or_cap.m4 index 3df6163da..3c3c6ad22 100644 --- a/config/kernel-is_owner_or_cap.m4 +++ b/config/kernel-is_owner_or_cap.m4 @@ -11,13 +11,32 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OWNER_OR_CAPABLE], [ struct inode *ip = NULL; (void) inode_owner_or_capable(ip); ]) + + ZFS_LINUX_TEST_SRC([inode_owner_or_capable_idmapped], [ + #include <linux/fs.h> + ],[ + struct inode *ip = NULL; + (void) inode_owner_or_capable(&init_user_ns, ip); + ]) ]) AC_DEFUN([ZFS_AC_KERNEL_INODE_OWNER_OR_CAPABLE], [ AC_MSG_CHECKING([whether inode_owner_or_capable() exists]) ZFS_LINUX_TEST_RESULT([inode_owner_or_capable], [ AC_MSG_RESULT(yes) - ],[ - ZFS_LINUX_TEST_ERROR([capability]) + AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE, 1, + [inode_owner_or_capable() exists]) + ], [ + AC_MSG_RESULT(no) + + AC_MSG_CHECKING( + [whether inode_owner_or_capable() takes user_ns]) + ZFS_LINUX_TEST_RESULT([inode_owner_or_capable_idmapped], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE_IDMAPPED, 1, + [inode_owner_or_capable() takes user_ns]) + ],[ + ZFS_LINUX_TEST_ERROR([capability]) + ]) ]) ]) |