mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Linux 6.3 compat: idmapped mount API changes
Linux kernel 6.3 changed a bunch of APIs to use the dedicated idmap type for mounts (struct mnt_idmap), we need to detect these changes and make zfs work with the new APIs. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Youzhong Yang <yyang@mathworks.com> Closes #14682
This commit is contained in:
@@ -27,26 +27,48 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_SETATTR_PREPARE], [
|
||||
int error __attribute__ ((unused)) =
|
||||
setattr_prepare(userns, dentry, attr);
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 6.3 API change
|
||||
dnl # The first arg of setattr_prepare() is changed to struct mnt_idmap*
|
||||
dnl #
|
||||
ZFS_LINUX_TEST_SRC([setattr_prepare_mnt_idmap], [
|
||||
#include <linux/fs.h>
|
||||
], [
|
||||
struct dentry *dentry = NULL;
|
||||
struct iattr *attr = NULL;
|
||||
struct mnt_idmap *idmap = NULL;
|
||||
int error __attribute__ ((unused)) =
|
||||
setattr_prepare(idmap, dentry, attr);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SETATTR_PREPARE], [
|
||||
AC_MSG_CHECKING([whether setattr_prepare() is available and accepts struct user_namespace*])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([setattr_prepare_userns],
|
||||
AC_MSG_CHECKING([whether setattr_prepare() is available and accepts struct mnt_idmap*])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([setattr_prepare_mnt_idmap],
|
||||
[setattr_prepare], [fs/attr.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SETATTR_PREPARE_USERNS, 1,
|
||||
[setattr_prepare() accepts user_namespace])
|
||||
AC_DEFINE(HAVE_SETATTR_PREPARE_IDMAP, 1,
|
||||
[setattr_prepare() accepts mnt_idmap])
|
||||
], [
|
||||
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_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_NO_USERNS, 1,
|
||||
[setattr_prepare() is available, doesn't accept user_namespace])
|
||||
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)
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user