mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 18:11:00 +03:00
Handle zio_resume and mmp => off
When multihost is disabled on a pool, and the pool is resumed via zpool clear, within a single cycle of the mmp thread's loop (e.g. while it's in the cv_timedwait call), both mmp_last_write and mmp_delay should be updated. The original code mistakenly treated the two cases as if they could not occur at the same time. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Olaf Faaland <faaland1@llnl.gov> Closes #7286
This commit is contained in:
parent
dc0176eeec
commit
267fd7b0f1
@ -409,16 +409,22 @@ mmp_thread(spa_t *spa)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When MMP goes off => on, or spa goes suspended =>
|
* MMP off => on, or suspended => !suspended:
|
||||||
* !suspended, we know no writes occurred recently. We
|
* No writes occurred recently. Update mmp_last_write to give
|
||||||
* update mmp_last_write to give us some time to try.
|
* us some time to try.
|
||||||
*/
|
*/
|
||||||
if ((!last_spa_multihost && multihost) ||
|
if ((!last_spa_multihost && multihost) ||
|
||||||
(last_spa_suspended && !suspended)) {
|
(last_spa_suspended && !suspended)) {
|
||||||
mutex_enter(&mmp->mmp_io_lock);
|
mutex_enter(&mmp->mmp_io_lock);
|
||||||
mmp->mmp_last_write = gethrtime();
|
mmp->mmp_last_write = gethrtime();
|
||||||
mutex_exit(&mmp->mmp_io_lock);
|
mutex_exit(&mmp->mmp_io_lock);
|
||||||
} else if (last_spa_multihost && !multihost) {
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MMP on => off:
|
||||||
|
* mmp_delay == 0 tells importing node to skip activity check.
|
||||||
|
*/
|
||||||
|
if (last_spa_multihost && !multihost) {
|
||||||
mutex_enter(&mmp->mmp_io_lock);
|
mutex_enter(&mmp->mmp_io_lock);
|
||||||
mmp->mmp_delay = 0;
|
mmp->mmp_delay = 0;
|
||||||
mutex_exit(&mmp->mmp_io_lock);
|
mutex_exit(&mmp->mmp_io_lock);
|
||||||
|
Loading…
Reference in New Issue
Block a user