mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-04-06 17:49:11 +03:00
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:
parent
4f3218aed8
commit
8133679ff0
@ -2763,6 +2763,13 @@ ztest_mmp_enable_disable(ztest_ds_t *zd, uint64_t id)
|
|||||||
if (zo->zo_mmp_test)
|
if (zo->zo_mmp_test)
|
||||||
return;
|
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);
|
spa_config_enter(spa, SCL_CONFIG, FTAG, RW_READER);
|
||||||
mutex_enter(&spa->spa_props_lock);
|
mutex_enter(&spa->spa_props_lock);
|
||||||
|
|
||||||
|
@ -1013,6 +1013,9 @@ Clears device errors in a pool.
|
|||||||
If no arguments are specified, all device errors within the pool are cleared.
|
If no arguments are specified, all device errors within the pool are cleared.
|
||||||
If one or more devices is specified, only those errors associated with the
|
If one or more devices is specified, only those errors associated with the
|
||||||
specified device or devices are cleared.
|
specified device or devices are cleared.
|
||||||
|
If multihost is enabled, and the pool has been suspended, this will not
|
||||||
|
resume I/O. While the pool was suspended, it may have been imported on
|
||||||
|
another host, and resuming I/O could result in pool damage.
|
||||||
.It Xo
|
.It Xo
|
||||||
.Nm
|
.Nm
|
||||||
.Cm create
|
.Cm create
|
||||||
|
@ -5251,6 +5251,13 @@ zfs_ioc_clear(zfs_cmd_t *zc)
|
|||||||
if (error != 0)
|
if (error != 0)
|
||||||
return (error);
|
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);
|
spa_vdev_state_enter(spa, SCL_NONE);
|
||||||
|
|
||||||
if (zc->zc_guid == 0) {
|
if (zc->zc_guid == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user