FreeBSD: Fix potential boot panic with bad label
vdev_geom_read_pool_label() can leave NULL in configs. Check for it
and skip consistently when generating rootconf.
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #14291
(cherry picked from commit dc8c2f6158
)
This commit is contained in:
parent
e84a2ed7a8
commit
fbbc375d43
|
@ -95,6 +95,8 @@ spa_generate_rootconf(const char *name)
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
uint64_t txg;
|
uint64_t txg;
|
||||||
|
|
||||||
|
if (configs[i] == NULL)
|
||||||
|
continue;
|
||||||
txg = fnvlist_lookup_uint64(configs[i], ZPOOL_CONFIG_POOL_TXG);
|
txg = fnvlist_lookup_uint64(configs[i], ZPOOL_CONFIG_POOL_TXG);
|
||||||
if (txg > best_txg) {
|
if (txg > best_txg) {
|
||||||
best_txg = txg;
|
best_txg = txg;
|
||||||
|
|
Loading…
Reference in New Issue