diff options
author | Olaf Faaland <[email protected]> | 2018-03-08 15:21:54 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2018-03-09 15:42:11 -0800 |
commit | ebed90a598677dfba76c95cf184549dbc1cb6be5 (patch) | |
tree | 7cc809a7486f50ce8952dac4518fb5895df38a56 | |
parent | 5ee220ba5c825263ce6f77106914bda35e60ef06 (diff) |
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 <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Signed-off-by: Olaf Faaland <[email protected]>
Closes #7286
-rw-r--r-- | module/zfs/mmp.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/module/zfs/mmp.c b/module/zfs/mmp.c index cb0aa53d6..420b8441c 100644 --- a/module/zfs/mmp.c +++ b/module/zfs/mmp.c @@ -474,16 +474,22 @@ mmp_thread(void *arg) } /* - * When MMP goes off => on, or spa goes suspended => - * !suspended, we know no writes occurred recently. We - * update mmp_last_write to give us some time to try. + * MMP off => on, or suspended => !suspended: + * No writes occurred recently. Update mmp_last_write to give + * us some time to try. */ if ((!last_spa_multihost && multihost) || (last_spa_suspended && !suspended)) { mutex_enter(&mmp->mmp_io_lock); mmp->mmp_last_write = gethrtime(); 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); mmp->mmp_delay = 0; mutex_exit(&mmp->mmp_io_lock); |