libsa/zfs: ignore labels with zero txg

Zero txg means this vdev has been correctly removed from the pool.  For
reference see module/zfs/vdev_removal.c in OpenZFS.  It calls
vdev_label_init(vd, 0, VDEV_LABEL_REMOVE), and second argument there is
the txg to write.

Reviewed by:		tsoome, mav, imp
Differential Revision:	https://reviews.freebsd.org/D51910
This commit is contained in:
Gleb Smirnoff
2025-08-20 07:51:08 -07:00
parent 5d5d03356e
commit de055556a0
+2 -1
View File
@@ -2081,6 +2081,7 @@ vdev_probe(vdev_phys_read_t *_read, vdev_phys_write_t *_write, void *priv,
if (nvlist_find(nvl, ZPOOL_CONFIG_POOL_TXG, DATA_TYPE_UINT64,
NULL, &txg, NULL) != 0 ||
txg == 0 ||
nvlist_find(nvl, ZPOOL_CONFIG_TOP_GUID, DATA_TYPE_UINT64,
NULL, &top_guid, NULL) != 0 ||
nvlist_find(nvl, ZPOOL_CONFIG_POOL_GUID, DATA_TYPE_UINT64,
@@ -2090,7 +2091,7 @@ vdev_probe(vdev_phys_read_t *_read, vdev_phys_write_t *_write, void *priv,
nvlist_find(nvl, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64,
NULL, &guid, NULL) != 0) {
/*
* Cache and spare devices end up here - just ignore
* Cache, spare and replaced devices end up here - just ignore
* them.
*/
nvlist_destroy(nvl);