Skip to content

Commit 2d5622f

Browse files
authored
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. Reviewed-by: Richard Yao <[email protected]> Reviewed-by: Serapheim Dimitropoulos <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Wilson <[email protected]> Closes #13781
1 parent 5bc0318 commit 2d5622f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/libzutil/zutil_import.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,8 @@ zpool_find_import_cached(libpc_handle_t *hdl, importargs_t *iarg)
16941694
* caller.
16951695
*/
16961696
nvpair_t *pair = nvlist_next_nvpair(nv, NULL);
1697+
if (pair == NULL)
1698+
continue;
16971699
fnvlist_add_nvlist(pools, nvpair_name(pair),
16981700
fnvpair_value_nvlist(pair));
16991701

0 commit comments

Comments
 (0)