mirror_zfs/lib/libspl/include
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
..
os libspl/include: remove unused/empty headers 2022-05-18 12:10:43 -07:00
rpc autoconf: use include directives instead of recursing down lib 2022-05-10 10:18:11 -07:00
sys Add Linux namespace delegation support 2022-06-10 09:51:46 -07:00
assert.h Add --enable-asan and --enable-ubsan switches 2022-02-03 14:35:38 -08:00
atomic.h More aggsum optimizations 2021-06-07 09:02:47 -07:00
libgen.h zpool import -d to specify device path 2018-01-26 10:49:46 -08:00
libshare.h Publish libshare protocols, use enum-based API 2022-05-12 09:26:38 -07:00
Makefile.am libspl/include: remove unused/empty headers 2022-05-18 12:10:43 -07:00
statcommon.h Add linux libspl support 2010-08-31 13:41:59 -07:00
stdlib.h cstyle: Resolve C style issues 2013-12-18 16:46:35 -08:00
string.h Check for strlcat and strlcpy 2018-12-11 16:01:41 -08:00
umem.h module/*.ko: prune .data, global .rodata 2022-01-14 15:37:55 -08:00
unistd.h Retire HAVE_IOCTL_* configure checks 2014-08-28 07:45:54 -07:00
zone.h Add Linux namespace delegation support 2022-06-10 09:51:46 -07:00