mirror_zfs/lib/libzutil
Tony Hutter 7e56b05058
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-02-20 20:17:45 -08:00
..
os Better zfs_get_enclosure_sysfs_path() enclosure support 2021-02-20 20:17:45 -08:00
Makefile.am cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
zutil_device_path.c OpenZFS restructuring - libzutil 2019-10-03 10:20:44 -07:00
zutil_import.c Add "compatibility" property for zpool feature sets 2021-02-17 21:30:45 -08:00
zutil_import.h OpenZFS restructuring - libzutil 2019-10-03 10:20:44 -07:00
zutil_nicenum.c OpenZFS restructuring - zpool 2019-09-30 12:16:06 -07:00
zutil_pool.c Add libzutil for libzfs or libzpool consumers 2018-11-05 11:22:33 -08:00