From d8d418ff0cc90776182534bce10b01e9487b63e4 Mon Sep 17 00:00:00 2001 From: loli10K Date: Sat, 9 Feb 2019 00:44:15 +0100 Subject: 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 Reviewed-by: Matt Ahrens Reviewed-by: Brian Behlendorf Reviewed-by: Tom Caputi Signed-off-by: loli10K --- include/sys/fs/zfs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sys/fs') diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h index 945853739..395d2e27f 100644 --- a/include/sys/fs/zfs.h +++ b/include/sys/fs/zfs.h @@ -1256,6 +1256,7 @@ typedef enum { ZFS_ERR_IOC_ARG_UNAVAIL, ZFS_ERR_IOC_ARG_REQUIRED, ZFS_ERR_IOC_ARG_BADTYPE, + ZFS_ERR_WRONG_PARENT, } zfs_errno_t; /* -- cgit v1.2.3