File tree Expand file tree Collapse file tree 4 files changed +40
-1
lines changed Expand file tree Collapse file tree 4 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -23,3 +23,28 @@ AC_DEFUN([ZFS_AC_KERNEL_IDMAP_MNT_API], [
23
23
] )
24
24
] )
25
25
26
+ dnl #
27
+ dnl # 6.8 decouples mnt_idmap from user_namespace. This is all internal
28
+ dnl # to mnt_idmap so we can't detect it directly, but we detect a related
29
+ dnl # change as use that as a signal.
30
+ dnl #
31
+ AC_DEFUN ( [ ZFS_AC_KERNEL_SRC_IDMAP_NO_USERNS] , [
32
+ ZFS_LINUX_TEST_SRC([ idmap_no_userns] , [
33
+ #include <linux/uidgid.h>
34
+ ] , [
35
+ struct uid_gid_map *map = NULL;
36
+ map_id_down(map, 0);
37
+ ] )
38
+ ] )
39
+
40
+
41
+ AC_DEFUN ( [ ZFS_AC_KERNEL_IDMAP_NO_USERNS] , [
42
+ AC_MSG_CHECKING ( [ whether idmapped mounts have a user namespace] )
43
+ ZFS_LINUX_TEST_RESULT([ idmap_no_userns] , [
44
+ AC_MSG_RESULT ( [ yes] )
45
+ AC_DEFINE ( HAVE_IDMAP_NO_USERNS , 1 ,
46
+ [ mnt_idmap does not have user_namespace] )
47
+ ] , [
48
+ AC_MSG_RESULT ( [ no] )
49
+ ] )
50
+ ] )
Original file line number Diff line number Diff line change @@ -158,6 +158,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
158
158
ZFS_AC_KERNEL_SRC___COPY_FROM_USER_INATOMIC
159
159
ZFS_AC_KERNEL_SRC_USER_NS_COMMON_INUM
160
160
ZFS_AC_KERNEL_SRC_IDMAP_MNT_API
161
+ ZFS_AC_KERNEL_SRC_IDMAP_NO_USERNS
161
162
ZFS_AC_KERNEL_SRC_IATTR_VFSID
162
163
ZFS_AC_KERNEL_SRC_FILEMAP
163
164
ZFS_AC_KERNEL_SRC_WRITEPAGE_T
@@ -305,6 +306,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
305
306
ZFS_AC_KERNEL___COPY_FROM_USER_INATOMIC
306
307
ZFS_AC_KERNEL_USER_NS_COMMON_INUM
307
308
ZFS_AC_KERNEL_IDMAP_MNT_API
309
+ ZFS_AC_KERNEL_IDMAP_NO_USERNS
308
310
ZFS_AC_KERNEL_IATTR_VFSID
309
311
ZFS_AC_KERNEL_FILEMAP
310
312
ZFS_AC_KERNEL_WRITEPAGE_T
Original file line number Diff line number Diff line change @@ -73,7 +73,8 @@ static inline struct user_namespace *zfs_i_user_ns(struct inode *inode)
73
73
static inline boolean_t zfs_no_idmapping (struct user_namespace * mnt_userns ,
74
74
struct user_namespace * fs_userns )
75
75
{
76
- return (zfs_is_init_userns (mnt_userns ) || mnt_userns == fs_userns );
76
+ return (mnt_userns == NULL || zfs_is_init_userns (mnt_userns ) ||
77
+ mnt_userns == fs_userns );
77
78
}
78
79
79
80
static inline uid_t zfs_uid_to_vfsuid (zidmap_t * mnt_userns ,
Original file line number Diff line number Diff line change @@ -57,12 +57,23 @@ typedef int minor_t;
57
57
struct user_namespace ;
58
58
#ifdef HAVE_IOPS_CREATE_IDMAP
59
59
#include <linux/refcount.h>
60
+ #ifdef HAVE_IDMAP_NO_USERNS
61
+ #include <linux/user_namespace.h>
62
+ struct mnt_idmap {
63
+ struct uid_gid_map uid_map ;
64
+ struct uid_gid_map gid_map ;
65
+ refcount_t count ;
66
+ };
67
+ typedef struct mnt_idmap zidmap_t ;
68
+ #define idmap_owner (p ) (NULL)
69
+ #else
60
70
struct mnt_idmap {
61
71
struct user_namespace * owner ;
62
72
refcount_t count ;
63
73
};
64
74
typedef struct mnt_idmap zidmap_t ;
65
75
#define idmap_owner (p ) (((struct mnt_idmap *)p)->owner)
76
+ #endif
66
77
#else
67
78
typedef struct user_namespace zidmap_t ;
68
79
#define idmap_owner (p ) ((struct user_namespace *)p)
You can’t perform that action at this time.
0 commit comments