Skip to content

Commit

Permalink
FreeBSD: Fix potential boot panic with bad label
Browse files Browse the repository at this point in the history
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 openzfs#14291
  • Loading branch information
Ryan Moeller authored Dec 22, 2022
1 parent 018f260 commit dc8c2f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions module/os/freebsd/zfs/spa_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ spa_generate_rootconf(const char *name)
for (i = 0; i < count; i++) {
uint64_t txg;

if (configs[i] == NULL)
continue;
txg = fnvlist_lookup_uint64(configs[i], ZPOOL_CONFIG_POOL_TXG);
if (txg > best_txg) {
best_txg = txg;
Expand Down

0 comments on commit dc8c2f6

Please sign in to comment.