]> git.proxmox.com Git - mirror_zfs.git/commit - cmd/ztest.c
ztest: Fix spa_open() ENOENT failures
authorBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 6 Jun 2020 19:51:35 +0000 (12:51 -0700)
committerGitHub <noreply@github.com>
Sat, 6 Jun 2020 19:51:35 +0000 (12:51 -0700)
commitc1f3de18a4347c3aceee114e6681c2055e8863f8
treef0915909e8d30a8b766bbaadc0e55677019a278f
parent13dd63ff81e5c774a9ff9522e5dd008dac1fc150
ztest: Fix spa_open() ENOENT failures

The pool may not be imported when the previous pass is terminated.
In which case, spa_open() will return ENOENT to indicate the pool
is not currently imported.  Refactor to code slightly to handle
this case by importing the pool and then retrying the spa_open().

The ztest_import() function was moved before ztest_run() and the
import logic split in to a small internal helper function.  The
ztest_freeze() function was also moved but no changes were made.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #10407
cmd/ztest/ztest.c