mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
zpool: fix redundancy check after vdev removal
The presence of indirect vdevs was confusing get_redundancy(), which considered a pool with e.g. only mirror top-level vdevs and at least one indirect vdev (due to the removal of a previous vdev) as already having a broken redundancy, which is not the case. This lead to the possibility of compromising the redundancy of a pool by adding mismatched vdevs without requiring the use of `-f`, and with no visible notice or warning. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Stéphane Lesimple <speed47_github@speed47.net> Closes #13705 Closes #13711
This commit is contained in:
committed by
GitHub
parent
c26045b435
commit
4fc1ea9c6c
@@ -514,9 +514,14 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
|
||||
if (is_log)
|
||||
continue;
|
||||
|
||||
/* Ignore holes introduced by removing aux devices */
|
||||
/*
|
||||
* Ignore holes introduced by removing aux devices, along
|
||||
* with indirect vdevs introduced by previously removed
|
||||
* vdevs.
|
||||
*/
|
||||
verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_TYPE, &type) == 0);
|
||||
if (strcmp(type, VDEV_TYPE_HOLE) == 0)
|
||||
if (strcmp(type, VDEV_TYPE_HOLE) == 0 ||
|
||||
strcmp(type, VDEV_TYPE_INDIRECT) == 0)
|
||||
continue;
|
||||
|
||||
if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
|
||||
|
||||
Reference in New Issue
Block a user