Skip to content

Commit

Permalink
zed: Allow autoreplace and fault LEDs for removed vdevs
Browse files Browse the repository at this point in the history
Allow zed to autoreplace vdevs marked as REMOVED.  Also update
statechange-led zedlet to toggle fault LEDs for REMOVED vdevs.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tony Hutter <[email protected]>
Closes #15281
  • Loading branch information
tonyhutter authored and behlendorf committed Sep 19, 2023
1 parent 0ce7a06 commit 54c6fbd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/zed/agents/zfs_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ zfs_process_add(zpool_handle_t *zhp, nvlist_t *vdev, boolean_t labeled)
/* Only autoreplace bad disks */
if ((vs->vs_state != VDEV_STATE_DEGRADED) &&
(vs->vs_state != VDEV_STATE_FAULTED) &&
(vs->vs_state != VDEV_STATE_REMOVED) &&
(vs->vs_state != VDEV_STATE_CANT_OPEN)) {
zed_log_msg(LOG_INFO, " not autoreplacing since disk isn't in "
"a bad state (currently %llu)", vs->vs_state);
Expand Down
2 changes: 1 addition & 1 deletion cmd/zed/zed.d/statechange-led.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ state_to_val()
{
state="$1"
case "$state" in
FAULTED|DEGRADED|UNAVAIL)
FAULTED|DEGRADED|UNAVAIL|REMOVED)
echo 1
;;
ONLINE)
Expand Down

0 comments on commit 54c6fbd

Please sign in to comment.