From 9a3ea7594b1eadf25187d01ca47727ebea802709 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Tue, 5 Nov 2019 18:07:30 +0000 Subject: [PATCH] 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. --- stand/libsa/zfs/zfsimpl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c index 061b9cfa2b4c..fbf2db0e2818 100644 --- a/stand/libsa/zfs/zfsimpl.c +++ b/stand/libsa/zfs/zfsimpl.c @@ -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;