mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 01:51:00 +03:00
ztest: Fix scrub check in ztest_raidz_expand_check()
The scrub code may return EBUSY under several possible scenarios causing ztest to incorrectly ASSERT when verifying the result of a raidz expansion. Update the test case to allow EBUSY since it does not indicate pool damage. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #16627
This commit is contained in:
parent
cefef28e98
commit
4319e71402
19
cmd/ztest.c
19
cmd/ztest.c
@ -6717,6 +6717,17 @@ out:
|
|||||||
*
|
*
|
||||||
* Only after a full scrub has been completed is it safe to start injecting
|
* Only after a full scrub has been completed is it safe to start injecting
|
||||||
* data corruption. See the comment in zfs_fault_inject().
|
* data corruption. See the comment in zfs_fault_inject().
|
||||||
|
*
|
||||||
|
* EBUSY may be returned for the following six cases. It's the callers
|
||||||
|
* responsibility to handle them accordingly.
|
||||||
|
*
|
||||||
|
* Current state Requested
|
||||||
|
* 1. Normal Scrub Running Normal Scrub or Error Scrub
|
||||||
|
* 2. Normal Scrub Paused Error Scrub
|
||||||
|
* 3. Normal Scrub Paused Pause Normal Scrub
|
||||||
|
* 4. Error Scrub Running Normal Scrub or Error Scrub
|
||||||
|
* 5. Error Scrub Paused Pause Error Scrub
|
||||||
|
* 6. Resilvering Anything else
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
ztest_scrub_impl(spa_t *spa)
|
ztest_scrub_impl(spa_t *spa)
|
||||||
@ -8082,8 +8093,14 @@ ztest_raidz_expand_check(spa_t *spa)
|
|||||||
(void) printf("verifying an interrupted raidz "
|
(void) printf("verifying an interrupted raidz "
|
||||||
"expansion using a pool scrub ...\n");
|
"expansion using a pool scrub ...\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Will fail here if there is non-recoverable corruption detected */
|
/* Will fail here if there is non-recoverable corruption detected */
|
||||||
VERIFY0(ztest_scrub_impl(spa));
|
int error = ztest_scrub_impl(spa);
|
||||||
|
if (error == EBUSY)
|
||||||
|
error = 0;
|
||||||
|
|
||||||
|
VERIFY0(error);
|
||||||
|
|
||||||
if (ztest_opts.zo_verbose >= 1) {
|
if (ztest_opts.zo_verbose >= 1) {
|
||||||
(void) printf("raidz expansion scrub check complete\n");
|
(void) printf("raidz expansion scrub check complete\n");
|
||||||
}
|
}
|
||||||
|
@ -2796,7 +2796,7 @@ zpool_scan(zpool_handle_t *zhp, pool_scan_func_t func, pool_scrub_cmd_t cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* With EBUSY, five cases are possible:
|
* With EBUSY, six cases are possible:
|
||||||
*
|
*
|
||||||
* Current state Requested
|
* Current state Requested
|
||||||
* 1. Normal Scrub Running Normal Scrub or Error Scrub
|
* 1. Normal Scrub Running Normal Scrub or Error Scrub
|
||||||
|
Loading…
Reference in New Issue
Block a user