mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-05-03 23:42:43 +03:00
Fix waiting in ztest_device_removal()
spa->spa_vdev_removal is created in a sync task that is initiated via dsl_sync_task_nowait(). Since the task may not run before spa_vdev_remove() returns, we must wait at least 1 txg to ensure that the removal struct has been created. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com> Reviewed-by: Matthew Ahrens <mahrens@delphix.com> Signed-off-by: Tom Caputi <tcaputi@datto.com> Closes #8010
This commit is contained in:
parent
7ab96299e5
commit
7d658d29cf
@ -3549,6 +3549,15 @@ ztest_device_removal(ztest_ds_t *zd, uint64_t id)
|
|||||||
ztest_device_removal_active = B_TRUE;
|
ztest_device_removal_active = B_TRUE;
|
||||||
mutex_exit(&ztest_vdev_lock);
|
mutex_exit(&ztest_vdev_lock);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* spa->spa_vdev_removal is created in a sync task that
|
||||||
|
* is initiated via dsl_sync_task_nowait(). Since the
|
||||||
|
* task may not run before spa_vdev_remove() returns, we
|
||||||
|
* must wait at least 1 txg to ensure that the removal
|
||||||
|
* struct has been created.
|
||||||
|
*/
|
||||||
|
txg_wait_synced(spa_get_dsl(spa), 0);
|
||||||
|
|
||||||
while (spa->spa_vdev_removal != NULL)
|
while (spa->spa_vdev_removal != NULL)
|
||||||
txg_wait_synced(spa_get_dsl(spa), 0);
|
txg_wait_synced(spa_get_dsl(spa), 0);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user