Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jun 2019 14:17:06 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r348907 - stable/12/cddl/contrib/opensolaris/lib/libzfs/common
Message-ID:  <201906111417.x5BEH6wt009676@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Tue Jun 11 14:17:05 2019
New Revision: 348907
URL: https://svnweb.freebsd.org/changeset/base/348907

Log:
  MFC r348557: 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>

Modified:
  stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
==============================================================================
--- stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Tue Jun 11 13:49:48 2019	(r348906)
+++ stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Tue Jun 11 14:17:05 2019	(r348907)
@@ -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);
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906111417.x5BEH6wt009676>