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 <ezomori.nozomu@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes #6933 
Closes #8460
This commit is contained in:
Olaf Faaland
2019-02-28 17:56:19 -08:00
committed by Brian Behlendorf
parent 4f3218aed8
commit 8133679ff0
3 changed files with 17 additions and 0 deletions
+7
View File
@@ -5251,6 +5251,13 @@ zfs_ioc_clear(zfs_cmd_t *zc)
if (error != 0)
return (error);
/*
* If multihost is enabled, resuming I/O is unsafe as another
* host may have imported the pool.
*/
if (spa_multihost(spa) && spa_suspended(spa))
return (SET_ERROR(EINVAL));
spa_vdev_state_enter(spa, SCL_NONE);
if (zc->zc_guid == 0) {