intel / ledmon

Enclosure LED Utilities
GNU General Public License v2.0
72 stars 49 forks source link

Ledmon changes device name assigned after every loop. #129

Open mtkaczyk opened 1 year ago

mtkaczyk commented 1 year ago

If there are multiple namespaces defined, I can see that ledmon is changing namespace assigned in every loop:

ll /sys/block/| grep nvme7 lrwxrwxrwx 1 root root 0 Mar 21 19:35 nvme7n1 -> ../devices/pci0000:5d/0000:5d:05.5/pci10001:00/10001:00:03.0/10001:02:00.0/nvme/nvme7/nvme7n1 lrwxrwxrwx 1 root root 0 Mar 21 19:35 nvme7n2 -> ../devices/pci0000:5d/0000:5d:05.5/pci10001:00/10001:00:03.0/10001:02:00.0/nvme/nvme7/nvme7n2

ledmon[56099]: NAME CHANGED /sys/devices/pci0000:5d/0000:5d:05.5/pci10001:00/10001:00:03.0/10001:02:00.0/nvme/nvme7/nvme7n1 to /sys/devices/pci0000:5d/0000:5d:05.5/pci10001:00/10001:00:03.0/10001:02:00.0/nvme/nvme7/nvme7n2 ledmon[56099]: NAME CHANGED /sys/devices/pci0000:5d/0000:5d:05.5/pci10001:00/10001:00:03.0/10001:02:00.0/nvme/nvme7/nvme7n2 to /sys/devices/pci0000:5d/0000:5d:05.5/pci10001:00/10001:00:03.0/10001:02:00.0/nvme/nvme7/nvme7n1

Next loop:

ledmon[56099]: NAME CHANGED /sys/devices/pci0000:5d/0000:5d:05.5/pci10001:00/10001:00:03.0/10001:02:00.0/nvme/nvme7/nvme7n1 to /sys/devices/pci0000:5d/0000:5d:05.5/pci10001:00/10001:00:03.0/10001:02:00.0/nvme/nvme7/nvme7n2 ledmon[56099]: NAME CHANGED /sys/devices/pci0000:5d/0000:5d:05.5/pci10001:00/10001:00:03.0/10001:02:00.0/nvme/nvme7/nvme7n2 to /sys/devices/pci0000:5d/0000:5d:05.5/pci10001:00/10001:00:03.0/10001:02:00.0/nvme/nvme7/nvme7n1

It could affect scenarios with multiple namespaces defined and VROC RAID array on top of first one, however I didn't dig into it. Need to be investigated.

ktanska commented 1 year ago

Probably fix is needed in block_compare() function for NPEM.