mirror_zfs/module/os/linux/zfs
Will Andrews 4ed5e25074 Add Linux namespace delegation support
This allows ZFS datasets to be delegated to a user/mount namespace
Within that namespace, only the delegated datasets are visible
Works very similarly to Zones/Jailes on other ZFS OSes

As a user:
```
 $ unshare -Um
 $ zfs list
no datasets available
 $ echo $$
1234
```

As root:
```
 # zfs list
NAME                            ZONED  MOUNTPOINT
containers                      off    /containers
containers/host                 off    /containers/host
containers/host/child           off    /containers/host/child
containers/host/child/gchild    off    /containers/host/child/gchild
containers/unpriv               on     /unpriv
containers/unpriv/child         on     /unpriv/child
containers/unpriv/child/gchild  on     /unpriv/child/gchild

 # zfs zone /proc/1234/ns/user containers/unpriv
```

Back to the user namespace:
```
 $ zfs list
NAME                             USED  AVAIL     REFER  MOUNTPOINT
containers                       129M  47.8G       24K  /containers
containers/unpriv                128M  47.8G       24K  /unpriv
containers/unpriv/child          128M  47.8G      128M  /unpriv/child
```

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Will Andrews <will.andrews@klarasystems.com>
Signed-off-by: Allan Jude <allan@klarasystems.com>
Signed-off-by: Mateusz Piotrowski <mateusz.piotrowski@klarasystems.com>
Co-authored-by: Allan Jude <allan@klarasystems.com>
Co-authored-by: Mateusz Piotrowski <mateusz.piotrowski@klarasystems.com>
Sponsored-by: Buddy <https://buddy.works>
Closes #12263
2022-06-10 09:51:46 -07:00
..
abd_os.c abd_os: remove redundant refcount creation for abd_children 2022-05-09 16:30:16 -07:00
arc_os.c Clean up CSTYLEDs 2022-01-26 11:38:52 -08:00
mmp_os.c Add zfs_multihost_interval tunable handler for FreeBSD 2020-06-23 13:32:42 -07:00
policy.c Add Linux namespace delegation support 2022-06-10 09:51:46 -07:00
qat_compress.c Modify checksum obtain method of QAT 2021-08-03 11:46:33 -06:00
qat_crypt.c Remove bcopy(), bzero(), bcmp() 2022-03-15 15:13:42 -07:00
qat.c QAT related bug fixes 2019-09-12 13:33:44 -07:00
spa_misc_os.c Add spa _os() hooks 2022-02-15 15:54:25 -08:00
trace.c Enable use of DTRACE_PROBE* macros in "spl" module 2019-11-01 13:13:43 -07:00
vdev_disk.c Linux 5.19 compat: blkdev_issue_secure_erase() 2022-05-31 12:04:26 -07:00
vdev_file.c module/*.ko: prune .data, global .rodata 2022-01-14 15:37:55 -08:00
zfs_acl.c Linux optimize access checks when ACL is trivial 2022-04-01 09:53:54 -07:00
zfs_ctldir.c Speed up WB_SYNC_NONE when a WB_SYNC_ALL occurs simultaneously 2022-05-03 13:23:26 -07:00
zfs_debug.c module/*.ko: prune .data, global .rodata 2022-01-14 15:37:55 -08:00
zfs_dir.c Remove bcopy(), bzero(), bcmp() 2022-03-15 15:13:42 -07:00
zfs_file_os.c file reference counts can get corrupted 2021-07-10 19:00:37 -06:00
zfs_ioctl_os.c Add Linux namespace delegation support 2022-06-10 09:51:46 -07:00
zfs_racct.c module: zfs: fix unused, remove argsused 2021-12-23 09:42:47 -08:00
zfs_sysfs.c Linux 5.18 compat: kobj_type.default_attrs replaced with default_groups 2022-04-22 14:27:10 -07:00
zfs_uio.c zvol: Support blk-mq for better performance 2022-06-09 08:10:38 -06:00
zfs_vfsops.c Add Linux namespace delegation support 2022-06-10 09:51:46 -07:00
zfs_vnops_os.c Speed up WB_SYNC_NONE when a WB_SYNC_ALL occurs simultaneously 2022-05-03 13:23:26 -07:00
zfs_znode.c Speed up WB_SYNC_NONE when a WB_SYNC_ALL occurs simultaneously 2022-05-03 13:23:26 -07:00
zio_crypt.c Remove bcopy(), bzero(), bcmp() 2022-03-15 15:13:42 -07:00
zpl_ctldir.c module: mark arguments used 2022-02-18 09:34:03 -08:00
zpl_export.c Return required size when encode_fh size too small 2021-05-07 15:08:16 -07:00
zpl_file.c Linux 5.19 compat: aops->read_folio() 2022-05-31 12:04:31 -07:00
zpl_inode.c Fix ACL checks for NFS kernel server 2022-03-18 06:47:57 -06:00
zpl_super.c Add Linux namespace delegation support 2022-06-10 09:51:46 -07:00
zpl_xattr.c Fix ACL checks for NFS kernel server 2022-03-18 06:47:57 -06:00
zvol_os.c zvol: Support blk-mq for better performance 2022-06-09 08:10:38 -06:00