zfs/lib
Tony Hutter 88a3751e67 Better zfs_get_enclosure_sysfs_path() enclosure support
A multpathed disk will have several 'underlying' paths to the disk.  For
example, multipath disk 'dm-0' may be made up of paths:
/dev/{sda,sdb,sdc,sdd}.  On many enclosures those underlying sysfs
paths will have a symlink back to their enclosure device entry
(like 'enclosure_device0/slot1').  This is used by the
statechange-led.sh script to set/clear the fault LED for a disk, and
by 'zpool status -c'.

However, on some enclosures, those underlying paths may not all have
symlinks back to the enclosure device.  Maybe only two out of four
of them might.

This patch updates zfs_get_enclosure_sysfs_path() to favor returning
paths that have symlinks back to their enclosure devices, rather
than just returning the first path.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #11617
2021-11-12 16:31:55 -08:00
..
libavl cppcheck: integrete cppcheck 2021-06-23 13:22:15 -07:00
libefi cppcheck: integrete cppcheck 2021-06-23 13:22:15 -07:00
libicp cppcheck: integrete cppcheck 2021-06-23 13:22:15 -07:00
libnvpair cppcheck: integrete cppcheck 2021-06-23 13:22:15 -07:00
libshare cppcheck: integrete cppcheck 2021-06-23 13:22:15 -07:00
libspl Use fallthrough macro 2021-11-12 15:24:36 -08:00
libtpool cppcheck: integrete cppcheck 2021-06-23 13:22:15 -07:00
libunicode cppcheck: integrete cppcheck 2021-06-23 13:22:15 -07:00
libuutil cppcheck: integrete cppcheck 2021-06-23 13:22:15 -07:00
libzfs Added error for writing to /dev/ on Linux 2021-11-12 16:31:55 -08:00
libzfs_core cppcheck: integrete cppcheck 2021-06-23 13:22:15 -07:00
libzfsbootenv Use fallthrough macro 2021-11-12 15:24:36 -08:00
libzpool file reference counts can get corrupted 2021-09-22 15:19:08 -07:00
libzstd cppcheck: integrete cppcheck 2021-06-23 13:22:15 -07:00
libzutil Better zfs_get_enclosure_sysfs_path() enclosure support 2021-11-12 16:31:55 -08:00
Makefile.am cppcheck: integrete cppcheck 2021-06-23 13:22:15 -07:00