diff options
author | Olaf Faaland <[email protected]> | 2019-02-28 17:56:19 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-02-28 17:56:19 -0800 |
commit | 8133679ff00b1a1434460111f1fa71d169575701 (patch) | |
tree | 62cd594fe020d2700609374be7de77a653aad706 /module/zfs | |
parent | 4f3218aed8be7e3a6f619b363ccdb6c4bf1bc680 (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 'module/zfs')
-rw-r--r-- | module/zfs/zfs_ioctl.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index f4aea57d4..ab40ae185 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -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) { |