summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2017-12-04 11:50:35 -0800
committerTony Hutter <[email protected]>2017-12-04 17:21:39 -0800
commitddd20dbe0bc3121247be66e4be5ea6b91253f485 (patch)
tree222f410d3cb3cb50d5e2ee6e859bd20d379d1a91 /cmd
parent4a98780933fd0510b00a560f6e4e1e4fa79a50ac (diff)
Fix 'zpool create|add' replication level check
When the pool configuration contains a hole due to a previous device removal ignore this top level vdev. Failure to do so will result in the current configuration being assessed to have a non-uniform replication level and the expected warning will be disabled. The zpool_add_010_pos test case was extended to cover this scenario. Reviewed-by: George Melikov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #6907 Closes #6911
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zpool/zpool_vdev.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd/zpool/zpool_vdev.c b/cmd/zpool/zpool_vdev.c
index 4c3793d6e..97faa5f9b 100644
--- a/cmd/zpool/zpool_vdev.c
+++ b/cmd/zpool/zpool_vdev.c
@@ -800,8 +800,11 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
if (is_log)
continue;
- verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_TYPE,
- &type) == 0);
+ /* Ignore holes introduced by removing aux devices */
+ verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_TYPE, &type) == 0);
+ if (strcmp(type, VDEV_TYPE_HOLE) == 0)
+ continue;
+
if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
&child, &children) != 0) {
/*