loader: populate nvl with data even when label_txg is 0

We actually do not use that data, at least not now, but we want to
avoid possible surprises.
This commit is contained in:
Toomas Soome 2019-11-05 18:07:30 +00:00
parent b0460c4c22
commit 9a3ea7594b

View File

@ -1641,8 +1641,10 @@ vdev_label_read_config(vdev_t *vd, uint64_t txg)
nvlist = (const unsigned char *) label->vp_nvlist + 4;
error = nvlist_find(nvlist, ZPOOL_CONFIG_POOL_TXG,
DATA_TYPE_UINT64, NULL, &label_txg);
if (error != 0 || label_txg == 0)
if (error != 0 || label_txg == 0) {
memcpy(nvl, nvlist, nvl_size);
return (nvl);
}
if (label_txg <= txg && label_txg > best_txg) {
best_txg = label_txg;