From 8133679ff00b1a1434460111f1fa71d169575701 Mon Sep 17 00:00:00 2001 From: Olaf Faaland Date: Thu, 28 Feb 2019 17:56:19 -0800 Subject: 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 ". The pool may have been imported on another host while I/O was suspended. Reviewed-by: loli10K Reviewed-by: Brian Behlendorf Signed-off-by: Olaf Faaland Closes #6933 Closes #8460 --- cmd/ztest/ztest.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cmd') 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); -- cgit v1.2.3