forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support idmapped mount in user namespace
Linux 5.17 commit torvalds/linux@5dfbfe71e enables "the idmapping infrastructure to support idmapped mounts of filesystems mounted with an idmapping". Update the OpenZFS accordingly to improve the idmapped mount support. This pull request contains the following changes: - xattr setter functions are fixed to take mnt_ns argument. Without this, cp -p would fail for an idmapped mount in a user namespace. - idmap_util is enhanced/fixed for its use in a user ns context. - One test case added to test idmapped mount in a user ns. Reviewed-by: Christian Brauner <christian@brauner.io> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Youzhong Yang <yyang@mathworks.com> Closes openzfs#14097
- Loading branch information
1 parent
1ebd7b6
commit c1f443b
Showing
21 changed files
with
424 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
dnl # | ||
dnl # 6.0 API change | ||
dnl # struct iattr has two unions for the uid and gid | ||
dnl # | ||
AC_DEFUN([ZFS_AC_KERNEL_SRC_IATTR_VFSID], [ | ||
ZFS_LINUX_TEST_SRC([iattr_vfsid], [ | ||
#include <linux/fs.h> | ||
], [ | ||
struct iattr ia; | ||
ia.ia_vfsuid = (vfsuid_t){0}; | ||
ia.ia_vfsgid = (vfsgid_t){0}; | ||
]) | ||
]) | ||
|
||
AC_DEFUN([ZFS_AC_KERNEL_IATTR_VFSID], [ | ||
AC_MSG_CHECKING([whether iattr->ia_vfsuid and iattr->ia_vfsgid exist]) | ||
ZFS_LINUX_TEST_RESULT([iattr_vfsid], [ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(HAVE_IATTR_VFSID, 1, | ||
[iattr->ia_vfsuid and iattr->ia_vfsgid exist]) | ||
],[ | ||
AC_MSG_RESULT(no) | ||
]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.