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 <ryao@gentoo.org> Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: George Wilson <gwilson@delphix.com> Closes #13781
This commit is contained in:
parent
5bc0318047
commit
2d5622f5be
|
@ -1694,6 +1694,8 @@ zpool_find_import_cached(libpc_handle_t *hdl, importargs_t *iarg)
|
||||||
* caller.
|
* caller.
|
||||||
*/
|
*/
|
||||||
nvpair_t *pair = nvlist_next_nvpair(nv, NULL);
|
nvpair_t *pair = nvlist_next_nvpair(nv, NULL);
|
||||||
|
if (pair == NULL)
|
||||||
|
continue;
|
||||||
fnvlist_add_nvlist(pools, nvpair_name(pair),
|
fnvlist_add_nvlist(pools, nvpair_name(pair),
|
||||||
fnvpair_value_nvlist(pair));
|
fnvpair_value_nvlist(pair));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue