mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 19:28:53 +03:00
Force fault a vdev with 'zpool offline -f'
This patch adds a '-f' option to 'zpool offline' to fault a vdev instead of bringing it offline. Unlike the OFFLINE state, the FAULTED state will trigger the FMA code, allowing for things like autoreplace and triggering the slot fault LED. The -f faults persist across imports, unless they were set with the temporary (-t) flag. Both persistent and temporary faults can be cleared with zpool clear. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tony Hutter <hutter2@llnl.gov> Closes #6094
This commit is contained in:
committed by
Brian Behlendorf
parent
a32df59e18
commit
4a283c7f77
@@ -519,6 +519,7 @@ vdev_config_generate(spa_t *spa, vdev_t *vd, boolean_t getstats,
|
||||
if (vd->vdev_ishole)
|
||||
fnvlist_add_uint64(nv, ZPOOL_CONFIG_IS_HOLE, B_TRUE);
|
||||
|
||||
/* Set the reason why we're FAULTED/DEGRADED. */
|
||||
switch (vd->vdev_stat.vs_aux) {
|
||||
case VDEV_AUX_ERR_EXCEEDED:
|
||||
aux = "err_exceeded";
|
||||
@@ -529,8 +530,15 @@ vdev_config_generate(spa_t *spa, vdev_t *vd, boolean_t getstats,
|
||||
break;
|
||||
}
|
||||
|
||||
if (aux != NULL)
|
||||
if (aux != NULL && !vd->vdev_tmpoffline) {
|
||||
fnvlist_add_string(nv, ZPOOL_CONFIG_AUX_STATE, aux);
|
||||
} else {
|
||||
/*
|
||||
* We're healthy - clear any previous AUX_STATE values.
|
||||
*/
|
||||
if (nvlist_exists(nv, ZPOOL_CONFIG_AUX_STATE))
|
||||
nvlist_remove_all(nv, ZPOOL_CONFIG_AUX_STATE);
|
||||
}
|
||||
|
||||
if (vd->vdev_splitting && vd->vdev_orig_guid != 0LL) {
|
||||
fnvlist_add_uint64(nv, ZPOOL_CONFIG_ORIG_GUID,
|
||||
|
||||
Reference in New Issue
Block a user