From 58d6f53677cd1485e55fe941e74385cd5743cb91 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 16 Oct 2009 10:41:40 -0700 Subject: [PATCH] Minor bug wholedisk is only valid for VDEV_DISK types. --- cmd/zpool/zpool_vdev.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/zpool/zpool_vdev.c b/cmd/zpool/zpool_vdev.c index 8dfce7ef8f..ae2e7b59f5 100644 --- a/cmd/zpool/zpool_vdev.c +++ b/cmd/zpool/zpool_vdev.c @@ -1083,7 +1083,7 @@ check_in_use(nvlist_t *config, nvlist_t *nv, int force, int isreplacing, char *type, *path; int ret = 0; char buf[MAXPATHLEN]; - uint64_t wholedisk; + uint64_t wholedisk = B_FALSE; verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_TYPE, &type) == 0); @@ -1091,8 +1091,9 @@ check_in_use(nvlist_t *config, nvlist_t *nv, int force, int isreplacing, &child, &children) != 0) { verify(!nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path)); - verify(!nvlist_lookup_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK, - &wholedisk)); + if (strcmp(type, VDEV_TYPE_DISK) == 0) + verify(!nvlist_lookup_uint64(nv, + ZPOOL_CONFIG_WHOLE_DISK, &wholedisk)); /* * As a generic check, we look to see if this is a replace of a