mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
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 <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes #11712
This commit is contained in:
@@ -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])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user