mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
3145 single-copy arc 3212 ztest: race condition between vdev_online() and spa_vdev_remove() Reviewed by: Matt Ahrens <matthew.ahrens@delphix.com> Reviewed by: Adam Leventhal <ahl@delphix.com> Reviewed by: Eric Schrock <eric.schrock@delphix.com> Reviewed by: Justin T. Gibbs <gibbs@scsiguy.com> Approved by: Eric Schrock <eric.schrock@delphix.com> References: illumos-gate/commit/9253d63df408bb48584e0b1abfcc24ef2472382e illumos changeset: 13840:97fd5cdf328a https://www.illumos.org/issues/3145 https://www.illumos.org/issues/3212 Ported-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #989 Closes #1137
This commit is contained in:
committed by
Brian Behlendorf
parent
753c38392d
commit
1eb5bfa3dc
@@ -4965,7 +4965,18 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
|
||||
if (islog)
|
||||
(void) rw_exit(&ztest_name_lock);
|
||||
} else {
|
||||
/*
|
||||
* Ideally we would like to be able to randomly
|
||||
* call vdev_[on|off]line without holding locks
|
||||
* to force unpredictable failures but the side
|
||||
* effects of vdev_[on|off]line prevent us from
|
||||
* doing so. We grab the ztest_vdev_lock here to
|
||||
* prevent a race between injection testing and
|
||||
* aux_vdev removal.
|
||||
*/
|
||||
mutex_enter(&ztest_vdev_lock);
|
||||
(void) vdev_online(spa, guid0, 0, NULL);
|
||||
mutex_exit(&ztest_vdev_lock);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user