From 3d93161b0112b0baa4f5483d03105bd77605ff8d Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 29 May 2020 21:14:10 -0700 Subject: [PATCH] ztest: Fix ztest_run_zdb() failure It's possible for ztest to be killed while the pool is exported which results in an empty cache file. This is a valid state to test, but the validation check performed by ztest_run_zdb() depends on the pool being in the cache file. If it's not the following error is printed. zdb -bccsv -G -d -Y -U /tmp/zloop-run/zpool.cache ztest zdb: can't open '/tmp/zloop-run': No such file or directory Resolve these failures by removing the dependency on the cache file. Functionally, we only care that the pool can be imported and that the zdb verification passes. Reviewed-by: George Melikov Reviewed-by: Ryan Moeller Signed-off-by: Brian Behlendorf Closes #10385 --- cmd/ztest/ztest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index 92b46c2968..ca49d99fd2 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -6457,11 +6457,11 @@ ztest_run_zdb(char *pool) ztest_get_zdb_bin(bin, len); (void) sprintf(zdb, - "%s -bcc%s%s -G -d -Y -U %s %s", + "%s -bcc%s%s -G -d -Y -e -p %s %s", bin, ztest_opts.zo_verbose >= 3 ? "s" : "", ztest_opts.zo_verbose >= 4 ? "v" : "", - spa_config_path, + ztest_opts.zo_dir, pool); if (ztest_opts.zo_verbose >= 5)