aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuri Pankov <[email protected]>2017-12-11 10:11:25 +0300
committerBrian Behlendorf <[email protected]>2018-01-11 13:52:03 -0800
commit8198c57b21d5e503f7e72221aa714aaabb2079cc (patch)
tree6670de79d1d98e6c07c5b400f729e34e096fc360
parent6a2185660d000c99b14556c7eb1108c5609faf41 (diff)
OpenZFS 8897 - zpool online -e fails assertion when run on non-leaf vdevs
Authored by: Yuri Pankov <[email protected]> Reviewed by: Toomas Soome <[email protected]> Reviewed by: Igor Kozhukhov <[email protected]> Reviewed-by: George Melikov <[email protected]> Approved by: Dan McDonald <[email protected]> Ported-by: Brian Behlendorf <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/8897 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/9a551dd645 Closes #7030
-rw-r--r--lib/libzfs/libzfs_pool.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c
index 46fb99aff..560d4cd28 100644
--- a/lib/libzfs/libzfs_pool.c
+++ b/lib/libzfs/libzfs_pool.c
@@ -2516,6 +2516,7 @@ zpool_vdev_online(zpool_handle_t *zhp, const char *path, int flags,
{
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;
@@ -2539,8 +2540,9 @@ zpool_vdev_online(zpool_handle_t *zhp, const char *path, int flags,
if (avail_spare)
return (zfs_error(hdl, EZFS_ISSPARE, msg));
- if (flags & ZFS_ONLINE_EXPAND ||
- zpool_get_prop_int(zhp, ZPOOL_PROP_AUTOEXPAND, 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,