]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFOpenZFS: ZVOLs should not be allowed to have children
authorfreqlabs <freqlabs@FreeBSD.org>
Wed, 25 Mar 2020 15:56:18 +0000 (15:56 +0000)
committerfreqlabs <freqlabs@FreeBSD.org>
Wed, 25 Mar 2020 15:56:18 +0000 (15:56 +0000)
commit5ea17928487a7e4727ac88353536af293baa0daf
tree50fc0866287daa7111a705d11e596f3c8fb29581
parentcaaa7694ce0e5768f5886f8d8b9bae76ff9fb1cd
MFOpenZFS: ZVOLs should not be allowed to have children

zfs create, receive and rename can bypass this hierarchy rule. Update
both userland and kernel module to prevent this issue and use pyzfs
unit tests to exercise the ioctls directly.

Note: this commit slightly changes zfs_ioc_create() ABI. This allow to
differentiate a generic error (EINVAL) from the specific case where we
tried to create a dataset below a ZVOL (ZFS_ERR_WRONG_PARENT).

Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tom Caputi <tcaputi@datto.com>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Approved by: mav (mentor)
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
openzfs/zfs@d8d418ff0cc90776182534bce10b01e9487b63e4
cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h