]> git.proxmox.com Git - mirror_zfs.git/commit
Support idmapped mount in user namespace
authoryouzhongyang <youzhong@gmail.com>
Tue, 8 Nov 2022 18:28:56 +0000 (13:28 -0500)
committerGitHub <noreply@github.com>
Tue, 8 Nov 2022 18:28:56 +0000 (10:28 -0800)
commitf224eddf922a33ca4b86d83148e9e6fa155fc290
treefbd3d2703fc4c00f0431c6e261c41b037f3f63ab
parent109731cd73c56c378b4c71732b9b9d3504a7a7e1
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 #14097
21 files changed:
config/kernel-iattr-vfsid.m4 [new file with mode: 0644]
config/kernel.m4
include/os/linux/kernel/linux/xattr_compat.h
include/os/linux/spl/sys/cred.h
include/os/linux/zfs/sys/policy.h
module/os/linux/zfs/policy.c
module/os/linux/zfs/zfs_acl.c
module/os/linux/zfs/zfs_dir.c
module/os/linux/zfs/zfs_vnops_os.c
module/os/linux/zfs/zfs_znode.c
module/os/linux/zfs/zpl_ctldir.c
module/os/linux/zfs/zpl_file.c
module/os/linux/zfs/zpl_inode.c
module/os/linux/zfs/zpl_xattr.c
module/zfs/zfs_replay.c
module/zfs/zfs_vnops.c
tests/runfiles/linux.run
tests/test-runner/bin/zts-report.py.in
tests/zfs-tests/cmd/idmap_util.c
tests/zfs-tests/tests/Makefile.am
tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_005.ksh [new file with mode: 0755]