From e88551d52f0490578ec6d2aa2c36563dfdbdd3b3 Mon Sep 17 00:00:00 2001 From: George Melikov Date: Wed, 18 Jan 2017 01:52:17 +0300 Subject: OpenZFS 7071 - lzc_snapshot does not fill in errlist on ENOENT Authored by: Igor Kozhukhov ikozhukhov@gmail.com Reviewed by: Igor Kozhukhov Reviewed by: George Wilson Reviewed by: Dan Kimmel Approved by: Robert Mustacchi Reviewed-by: Brian Behlendorf Ported-by: George Melikov OpenZFS-issue: https://www.illumos.org/issues/7071 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/25f7d99 Closes #5597 --- module/zfs/zfs_ioctl.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'module') diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index 439134dec..ba4e0ee3f 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -467,6 +467,14 @@ zfs_secpolicy_write_perms(const char *name, const char *perm, cred_t *cr) dsl_dataset_t *ds; dsl_pool_t *dp; + /* + * First do a quick check for root in the global zone, which + * is allowed to do all write_perms. This ensures that zfs_ioc_* + * will get to handle nonexistent datasets. + */ + if (INGLOBALZONE(curproc) && secpolicy_zfs(cr) == 0) + return (0); + error = dsl_pool_hold(name, FTAG, &dp); if (error != 0) return (error); -- cgit v1.2.3