mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Add FreeBSD jail support hooks
Add the 'zfs jail/unjail' subcommands along with the relevant documentation from FreeBSD. This feature is not supported on Linux and still requires the match kernel ioctls which will be included when the FreeBSD platform code is integrated. Reviewed-by: Jorgen Lundman <lundman@lundman.net> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Signed-off-by: Ryan Moeller <ryan@ixsystems.com> Closes #9686
This commit is contained in:
committed by
Brian Behlendorf
parent
657ce25357
commit
4bc721965f
@@ -379,8 +379,13 @@ zfs_prop_init(void)
|
||||
zprop_register_index(ZFS_PROP_READONLY, "readonly", 0, PROP_INHERIT,
|
||||
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "on | off", "RDONLY",
|
||||
boolean_table);
|
||||
#ifdef __FreeBSD__
|
||||
zprop_register_index(ZFS_PROP_ZONED, "jailed", 0, PROP_INHERIT,
|
||||
ZFS_TYPE_FILESYSTEM, "on | off", "JAILED", boolean_table);
|
||||
#else
|
||||
zprop_register_index(ZFS_PROP_ZONED, "zoned", 0, PROP_INHERIT,
|
||||
ZFS_TYPE_FILESYSTEM, "on | off", "ZONED", boolean_table);
|
||||
#endif
|
||||
zprop_register_index(ZFS_PROP_VSCAN, "vscan", 0, PROP_INHERIT,
|
||||
ZFS_TYPE_FILESYSTEM, "on | off", "VSCAN", boolean_table);
|
||||
zprop_register_index(ZFS_PROP_NBMAND, "nbmand", 0, PROP_INHERIT,
|
||||
|
||||
@@ -743,6 +743,7 @@ dsl_enforce_ds_ss_limits(dsl_dir_t *dd, zfs_prop_t prop, cred_t *cr)
|
||||
uint64_t obj;
|
||||
dsl_dataset_t *ds;
|
||||
uint64_t zoned;
|
||||
const char *zonedstr;
|
||||
|
||||
ASSERT(prop == ZFS_PROP_FILESYSTEM_LIMIT ||
|
||||
prop == ZFS_PROP_SNAPSHOT_LIMIT);
|
||||
@@ -763,7 +764,8 @@ dsl_enforce_ds_ss_limits(dsl_dir_t *dd, zfs_prop_t prop, cred_t *cr)
|
||||
if (dsl_dataset_hold_obj(dd->dd_pool, obj, FTAG, &ds) != 0)
|
||||
return (ENFORCE_ALWAYS);
|
||||
|
||||
if (dsl_prop_get_ds(ds, "zoned", 8, 1, &zoned, NULL) || zoned) {
|
||||
zonedstr = zfs_prop_to_name(ZFS_PROP_ZONED);
|
||||
if (dsl_prop_get_ds(ds, zonedstr, 8, 1, &zoned, NULL) || zoned) {
|
||||
/* Only root can access zoned fs's from the GZ */
|
||||
enforce = ENFORCE_ALWAYS;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user