Skip to content

Commit a06aa1b

Browse files
tonyhutterdefaziogiancarlo
authored andcommitted
zed: Allow autoreplace and fault LEDs for removed vdevs
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 openzfs#15281
1 parent c5c2b4d commit a06aa1b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

cmd/zed/agents/zfs_mod.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ zfs_process_add(zpool_handle_t *zhp, nvlist_t *vdev, boolean_t labeled)
384384
/* Only autoreplace bad disks */
385385
if ((vs->vs_state != VDEV_STATE_DEGRADED) &&
386386
(vs->vs_state != VDEV_STATE_FAULTED) &&
387+
(vs->vs_state != VDEV_STATE_REMOVED) &&
387388
(vs->vs_state != VDEV_STATE_CANT_OPEN)) {
388389
zed_log_msg(LOG_INFO, " not autoreplacing since disk isn't in "
389390
"a bad state (currently %d)", vs->vs_state);

cmd/zed/zed.d/statechange-led.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ state_to_val()
120120
{
121121
state="$1"
122122
case "$state" in
123-
FAULTED|DEGRADED|UNAVAIL)
123+
FAULTED|DEGRADED|UNAVAIL|REMOVED)
124124
echo 1
125125
;;
126126
ONLINE)

0 commit comments

Comments
 (0)