From 66119ced4451ca296904c7b3329db03f61362a27 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Thu, 18 Aug 2022 09:12:58 -0400 Subject: [PATCH] importing from cachefile can trip assertion When importing from cachefile, it is possible that the builtin retry logic will trip an assertion because it also fails to find the pool. This fix addresses that case and returns the correct error message to the user. Signed-off-by: George Wilson --- lib/libzutil/zutil_import.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libzutil/zutil_import.c b/lib/libzutil/zutil_import.c index 0bbf232f24a4..252b0bac685c 100644 --- a/lib/libzutil/zutil_import.c +++ b/lib/libzutil/zutil_import.c @@ -1694,6 +1694,8 @@ zpool_find_import_cached(libpc_handle_t *hdl, importargs_t *iarg) * caller. */ nvpair_t *pair = nvlist_next_nvpair(nv, NULL); + if (pair == NULL) + continue; fnvlist_add_nvlist(pools, nvpair_name(pair), fnvpair_value_nvlist(pair));