From f62db44dbcda5dd786bb821f1e6fd3ca2e6d4391 Mon Sep 17 00:00:00 2001 From: Andrew Stormont Date: Sun, 17 Jun 2018 11:53:29 +0100 Subject: [PATCH] 9616 Bogus error when attempting to set property on read-only pool Reviewed by: Paul Dagnelie Reviewed by: Matt Ahrens Approved by: Robert Mustacchi --- usr/src/lib/libzfs/common/libzfs_dataset.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/usr/src/lib/libzfs/common/libzfs_dataset.c b/usr/src/lib/libzfs/common/libzfs_dataset.c index 243565f463..c0fd0cec32 100644 --- a/usr/src/lib/libzfs/common/libzfs_dataset.c +++ b/usr/src/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 - * Copyright 2017 RackTop Systems. + * Copyright 2017-2018 RackTop Systems. */ #include @@ -1808,13 +1808,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); } -- 2.11.4.GIT