]> git.proxmox.com Git - zfsonlinux.git/blame - zfs-patches/0053-Handle-zio_resume-and-mmp-off.patch
bump version to 0.7.7-pve1~bpo9
[zfsonlinux.git] / zfs-patches / 0053-Handle-zio_resume-and-mmp-off.patch
CommitLineData
75b07eca
FG
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Olaf Faaland <faaland1@llnl.gov>
3Date: Thu, 8 Mar 2018 15:21:54 -0800
4Subject: [PATCH] Handle zio_resume and mmp => off
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9When multihost is disabled on a pool, and the pool is resumed via zpool
10clear, within a single cycle of the mmp thread's loop (e.g. while it's
11in the cv_timedwait call), both mmp_last_write and mmp_delay should be
12updated.
13
14The original code mistakenly treated the two cases as if they could not
15occur at the same time.
16
17Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
18Reviewed-by: Tony Hutter <hutter2@llnl.gov>
19Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
20Closes #7286
21(cherry picked from commit 267fd7b0f14251026c35d7ceab4fbbe2f06717e6)
22Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
23---
24 module/zfs/mmp.c | 14 ++++++++++----
25 1 file changed, 10 insertions(+), 4 deletions(-)
26
27diff --git a/module/zfs/mmp.c b/module/zfs/mmp.c
28index 634e48287..15eea41ab 100644
29--- a/module/zfs/mmp.c
30+++ b/module/zfs/mmp.c
31@@ -409,16 +409,22 @@ mmp_thread(spa_t *spa)
32 }
33
34 /*
35- * When MMP goes off => on, or spa goes suspended =>
36- * !suspended, we know no writes occurred recently. We
37- * update mmp_last_write to give us some time to try.
38+ * MMP off => on, or suspended => !suspended:
39+ * No writes occurred recently. Update mmp_last_write to give
40+ * us some time to try.
41 */
42 if ((!last_spa_multihost && multihost) ||
43 (last_spa_suspended && !suspended)) {
44 mutex_enter(&mmp->mmp_io_lock);
45 mmp->mmp_last_write = gethrtime();
46 mutex_exit(&mmp->mmp_io_lock);
47- } else if (last_spa_multihost && !multihost) {
48+ }
49+
50+ /*
51+ * MMP on => off:
52+ * mmp_delay == 0 tells importing node to skip activity check.
53+ */
54+ if (last_spa_multihost && !multihost) {
55 mutex_enter(&mmp->mmp_io_lock);
56 mmp->mmp_delay = 0;
57 mutex_exit(&mmp->mmp_io_lock);
58--
592.14.2
60