Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Feb 2018 00:21:42 +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-11@freebsd.org
Subject:   svn commit: r329488 - stable/11/cddl/contrib/opensolaris/lib/libzfs/common
Message-ID:  <201802180021.w1I0Lg8N058974@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun Feb 18 00:21:42 2018
New Revision: 329488
URL: https://svnweb.freebsd.org/changeset/base/329488

Log:
  MFC r328232:
  MFV r328231: 8897 zpool online -e fails assertion when run on non-leaf vdevs
  
  illumos/illumos-gate@9a551dd645b478816cb11251b19f5034d885bf01
  
  https://www.illumos.org/issues/8897:
  # zpool online -e test mirror-1
  Assertion failed: nvlist_lookup_string(tgt, "path", &pathname) == 0, file ../common/libzfs_pool.c, line 2558, function zpool_vdev_online
  Abort (core dumped)
  
  Not a big deal per se, but should be handled gracefully, same way as 'offline' and 'online' without '-e'.
  
  Also reported as: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221408
  
  Reviewed by: Toomas Soome <tsoome@me.com>
  Reviewed by: Igor Kozhukhov <igor@dilos.org>
  Approved by: Dan McDonald <danmcd@joyent.com>
  Author: Yuri Pankov <yuri.pankov@nexenta.com>

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

Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
==============================================================================
--- stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c	Sun Feb 18 00:20:46 2018	(r329487)
+++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c	Sun Feb 18 00:21:42 2018	(r329488)
@@ -2419,6 +2419,7 @@ zpool_vdev_online(zpool_handle_t *zhp, const char *pat
 {
 	zfs_cmd_t zc = { 0 };
 	char msg[1024];
+	char *pathname;
 	nvlist_t *tgt;
 	boolean_t avail_spare, l2cache, islog;
 	libzfs_handle_t *hdl = zhp->zpool_hdl;
@@ -2441,15 +2442,13 @@ zpool_vdev_online(zpool_handle_t *zhp, const char *pat
 	if (avail_spare)
 		return (zfs_error(hdl, EZFS_ISSPARE, msg));
 
-	if (flags & ZFS_ONLINE_EXPAND ||
-	    zpool_get_prop_int(zhp, ZPOOL_PROP_AUTOEXPAND, NULL)) {
-		char *pathname = NULL;
+	if ((flags & ZFS_ONLINE_EXPAND ||
+	    zpool_get_prop_int(zhp, ZPOOL_PROP_AUTOEXPAND, NULL)) &&
+	    nvlist_lookup_string(tgt, ZPOOL_CONFIG_PATH, &pathname) == 0) {
 		uint64_t wholedisk = 0;
 
 		(void) nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_WHOLE_DISK,
 		    &wholedisk);
-		verify(nvlist_lookup_string(tgt, ZPOOL_CONFIG_PATH,
-		    &pathname) == 0);
 
 		/*
 		 * XXX - L2ARC 1.0 devices can't support expansion.



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