aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/lib
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2019-06-03 17:19:05 +0000
committerAlexander Motin <mav@FreeBSD.org>2019-06-03 17:19:05 +0000
commitc4af53b8f1537e01f1b8d9e5ca146a17bee197df (patch)
tree5c6907b96952a5f80455f9072987979096d54a56 /cddl/contrib/opensolaris/lib
parent9afd2811871cdd41c617e8104f41f6dc2a627cf9 (diff)
parent0c5cf42060b08a45250bf262f0cef63f7ed817b9 (diff)
downloadsrc-c4af53b8f1537e01f1b8d9e5ca146a17bee197df.tar.gz
src-c4af53b8f1537e01f1b8d9e5ca146a17bee197df.zip
MFV r348534: 9616 Bogus error when attempting to set property on read-only pool
illumos/illumos-gate@f62db44dbcda5dd786bb821f1e6fd3ca2e6d4391 Reviewed by: Paul Dagnelie <pcd@delphix.com> Reviewed by: Matt Ahrens <matt@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Andrew Stormont <astormont@racktopsystems.com>
Notes
Notes: svn path=/head/; revision=348557
Diffstat (limited to 'cddl/contrib/opensolaris/lib')
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
index fcef8bf16f16..1d344b1f6f71 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
@@ -30,7 +30,7 @@
* Copyright (c) 2014 Integros [integros.com]
* Copyright 2017 Nexenta Systems, Inc.
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
- * Copyright 2017 RackTop Systems.
+ * Copyright 2017-2018 RackTop Systems.
*/
#include <ctype.h>
@@ -1842,13 +1842,18 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvlist_t *props)
ret = zfs_ioctl(hdl, ZFS_IOC_SET_PROP, &zc);
if (ret != 0) {
+ if (zc.zc_nvlist_dst_filled == B_FALSE) {
+ (void) zfs_standard_error(hdl, errno, errbuf);
+ goto error;
+ }
+
/* Get the list of unset properties back and report them. */
nvlist_t *errorprops = NULL;
if (zcmd_read_dst_nvlist(hdl, &zc, &errorprops) != 0)
goto error;
- for (nvpair_t *elem = nvlist_next_nvpair(nvl, NULL);
+ for (nvpair_t *elem = nvlist_next_nvpair(errorprops, NULL);
elem != NULL;
- elem = nvlist_next_nvpair(nvl, elem)) {
+ elem = nvlist_next_nvpair(errorprops, elem)) {
zfs_prop_t prop = zfs_name_to_prop(nvpair_name(elem));
zfs_setprop_error(hdl, prop, errno, errbuf);
}