aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorOlaf Faaland <[email protected]>2019-02-28 17:56:19 -0800
committerBrian Behlendorf <[email protected]>2019-02-28 17:56:19 -0800
commit8133679ff00b1a1434460111f1fa71d169575701 (patch)
tree62cd594fe020d2700609374be7de77a653aad706 /cmd
parent4f3218aed8be7e3a6f619b363ccdb6c4bf1bc680 (diff)
Do not resume a pool if multihost is enabled
When multihost is enabled, and a pool is suspended, return EINVAL in response to "zpool clear <pool>". The pool may have been imported on another host while I/O was suspended. Reviewed-by: loli10K <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Olaf Faaland <[email protected]> Closes #6933 Closes #8460
Diffstat (limited to 'cmd')
-rw-r--r--cmd/ztest/ztest.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
index adbf60c60..8cc6a6ff9 100644
--- a/cmd/ztest/ztest.c
+++ b/cmd/ztest/ztest.c
@@ -2763,6 +2763,13 @@ ztest_mmp_enable_disable(ztest_ds_t *zd, uint64_t id)
if (zo->zo_mmp_test)
return;
+ /*
+ * Since enabling MMP involves setting a property, it could not be done
+ * while the pool is suspended.
+ */
+ if (spa_suspended(spa))
+ return;
+
spa_config_enter(spa, SCL_CONFIG, FTAG, RW_READER);
mutex_enter(&spa->spa_props_lock);