summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2013-01-26 10:34:17 +0000
committeravg <avg@FreeBSD.org>2013-01-26 10:34:17 +0000
commit3986bee147cae9ee9ce2d9a28c28b1370ac19ec6 (patch)
tree390552107c93c20e5a3fde1973bbc4e5105cf62c
parentf0d9be20369e94230a8dc7583cbb7deb06c3c37d (diff)
downloadFreeBSD-src-3986bee147cae9ee9ce2d9a28c28b1370ac19ec6.zip
FreeBSD-src-3986bee147cae9ee9ce2d9a28c28b1370ac19ec6.tar.gz
spa_generate_rootconf: add support for old vdev labels
It seems that old ZFS versions (v15) completely omit "vdev_children" property when there is a single child. Reported by: jase Tested by: jase MFC after: 1 week
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
index 4392ea8..8da3f0e 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
@@ -3792,9 +3792,8 @@ spa_generate_rootconf(const char *name)
/*
* Multi-vdev root pool configuration discovery is not supported yet.
*/
- nchildren = 0;
- VERIFY(nvlist_lookup_uint64(best_cfg, ZPOOL_CONFIG_VDEV_CHILDREN,
- &nchildren) == 0);
+ nchildren = 1;
+ nvlist_lookup_uint64(best_cfg, ZPOOL_CONFIG_VDEV_CHILDREN, &nchildren);
holes = NULL;
nvlist_lookup_uint64_array(best_cfg, ZPOOL_CONFIG_HOLE_ARRAY,
&holes, &nholes);
OpenPOWER on IntegriCloud