diff options
author | Alexander Motin <mav@FreeBSD.org> | 2018-01-21 23:53:56 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2018-01-21 23:53:56 +0000 |
commit | 9b347baa3ac4b8472dd0d3bc7e825cbd82405619 (patch) | |
tree | 771427c33c831848e15b4c62714a772f1a42b89d /cddl/contrib/opensolaris/lib/libzfs | |
parent | 226cd471b4f70b704481c2537f1e6185ba1bcf8d (diff) | |
parent | adbaf378293ad9762b2d9ad2725e11ae8144ea58 (diff) |
Notes
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzfs')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c index 76f06e54a98b..ecffe1c0aec2 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c @@ -2419,6 +2419,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; @@ -2441,15 +2442,13 @@ 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)) { - 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. |