]> granicus.if.org Git - zfs/commit
Turn on/off enclosure slot fault LED even when disk isn't present
authorTony Hutter <hutter2@llnl.gov>
Mon, 24 Oct 2016 17:45:59 +0000 (10:45 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 24 Oct 2016 17:45:59 +0000 (10:45 -0700)
commit1bbd8770490f0e5b8c575865ab70f6853bca2a2a
tree302dc7e82db3c1b33739ec41998d95cfe0157450
parenta85cefa35c00ab4999038fbed69a6c28d0244366
Turn on/off enclosure slot fault LED even when disk isn't present

Previously when a drive faulted, the statechange-led.sh script would lookup
the drive's LED sysfs entry in /sys/block/sd*/device/enclosure_device, and
turn it on.  During testing we noticed that if you pulled out a drive, or if
the drive was so badly broken that it no longer appeared to Linux, that the
/sys/block/sd* path would be removed, and the script could not lookup the
LED entry.

To fix this, this patch looks up the disks's more persistent
"/sys/class/enclosure/X:X:X:X/Slot N" LED sysfs path at pool import.  It then
passes that path to the statechange-led script to use, rather than having the
script look it up on the fly.  This allows the script to turn on/off the slot
LEDs even when the drive is missing.

Closes #5309
Closes #2375
13 files changed:
cmd/zed/agents/zfs_mod.c
cmd/zed/zed.d/statechange-led.sh
cmd/zed/zed_disk_event.c
cmd/zed/zed_event.c
include/libzfs.h
include/sys/fm/fs/zfs.h
include/sys/fs/zfs.h
include/sys/vdev_impl.h
lib/libzfs/libzfs_import.c
lib/libzfs/libzfs_pool.c
module/zfs/vdev.c
module/zfs/vdev_label.c
module/zfs/zfs_fm.c