aboutsummaryrefslogtreecommitdiffstats
path: root/config/kernel-setattr-prepare.m4
diff options
context:
space:
mode:
authorColeman Kane <[email protected]>2021-03-20 00:00:59 -0400
committerGitHub <[email protected]>2021-03-19 21:00:59 -0700
commite2a8296131e94ad785f5564156ed2db1fdb2e080 (patch)
treea06b88b9027c0d410c34bfc9691e89e0a212e2a6 /config/kernel-setattr-prepare.m4
parent330c6c052314b530e5b271bc731d4040570c5fb0 (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-setattr-prepare.m4')
-rw-r--r--config/kernel-setattr-prepare.m445
1 files changed, 35 insertions, 10 deletions
diff --git a/config/kernel-setattr-prepare.m4 b/config/kernel-setattr-prepare.m4
index 45408c45c..24245aa53 100644
--- a/config/kernel-setattr-prepare.m4
+++ b/config/kernel-setattr-prepare.m4
@@ -1,27 +1,52 @@
-dnl #
-dnl # 4.9 API change
-dnl # The inode_change_ok() function has been renamed setattr_prepare()
-dnl # and updated to take a dentry rather than an inode.
-dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_SETATTR_PREPARE], [
+ dnl #
+ dnl # 4.9 API change
+ dnl # The inode_change_ok() function has been renamed setattr_prepare()
+ dnl # and updated to take a dentry rather than an inode.
+ dnl #
ZFS_LINUX_TEST_SRC([setattr_prepare], [
#include <linux/fs.h>
], [
struct dentry *dentry = NULL;
struct iattr *attr = NULL;
int error __attribute__ ((unused)) =
- setattr_prepare(dentry, attr);
+ setattr_prepare(dentry, attr);
+ ])
+
+ dnl #
+ dnl # 5.12 API change
+ dnl # The setattr_prepare() function has been changed to accept a new argument
+ dnl # for struct user_namespace*
+ dnl #
+ ZFS_LINUX_TEST_SRC([setattr_prepare_userns], [
+ #include <linux/fs.h>
+ ], [
+ struct dentry *dentry = NULL;
+ struct iattr *attr = NULL;
+ struct user_namespace *userns = NULL;
+ int error __attribute__ ((unused)) =
+ setattr_prepare(userns, dentry, attr);
])
])
AC_DEFUN([ZFS_AC_KERNEL_SETATTR_PREPARE], [
- AC_MSG_CHECKING([whether setattr_prepare() is available])
- ZFS_LINUX_TEST_RESULT_SYMBOL([setattr_prepare],
+ AC_MSG_CHECKING([whether setattr_prepare() is available and accepts struct user_namespace*])
+ ZFS_LINUX_TEST_RESULT_SYMBOL([setattr_prepare_userns],
[setattr_prepare], [fs/attr.c], [
AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_SETATTR_PREPARE, 1,
- [setattr_prepare() is available])
+ AC_DEFINE(HAVE_SETATTR_PREPARE_USERNS, 1,
+ [setattr_prepare() accepts user_namespace])
], [
AC_MSG_RESULT(no)
+
+ AC_MSG_CHECKING([whether setattr_prepare() is available, doesn't accept user_namespace])
+ ZFS_LINUX_TEST_RESULT_SYMBOL([setattr_prepare],
+ [setattr_prepare], [fs/attr.c], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SETATTR_PREPARE_NO_USERNS, 1,
+ [setattr_prepare() is available, doesn't accept user_namespace])
+ ], [
+ AC_MSG_RESULT(no)
+ ])
])
])