mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 19:04:45 +03:00
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
This commit is contained in:
committed by
Brian Behlendorf
parent
a85cefa35c
commit
1bbd877049
@@ -286,7 +286,7 @@ zed_udev_monitor(void *arg)
|
||||
udev_device_get_property_value(dev, "DM_UUID") &&
|
||||
udev_device_get_property_value(dev, "MPATH_SBIN_PATH")) {
|
||||
tmp = (char *) udev_device_get_devnode(dev);
|
||||
tmp2 = get_underlying_path(NULL, tmp);
|
||||
tmp2 = zfs_get_underlying_path(tmp);
|
||||
if (tmp && tmp2 && (strcmp(tmp, tmp2) != 0)) {
|
||||
/*
|
||||
* We have a real underlying device, which
|
||||
|
||||
Reference in New Issue
Block a user