HomeFreeBSD

Turn on/off enclosure slot fault LED even when disk isn't present

Description

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

Details

Provenance
Tony Hutter <hutter2@llnl.gov>Authored on Oct 24 2016, 5:45 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Oct 24 2016, 5:45 PM
Parents
rGa85cefa35c00: Change location of current symlink created by test-runner
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG1bbd8770490f: Turn on/off enclosure slot fault LED even when disk isn't present (authored by Tony Hutter <hutter2@llnl.gov>).Oct 24 2016, 5:45 PM