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 <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes openzfs#15281
  • Loading branch information
tonyhutter authored and behlendorf committed Nov 8, 2023
1 parent 628dd9e commit 8b8dde7
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 @@ -371,6 +371,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 %d)", 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 @@ -120,7 +120,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 8b8dde7

Please sign in to comment.