Open tbzatek opened 1 year ago
Hard to know where to start with this one. Is fixing udev out of the question?? From the lsscsi perspective, after a long pause, there is finally work going on. The impetus for this is to add JSON output support but I am trying to clean up the code as I go. So drastic changes could be made. Perhaps if the documented procedure for the "-i" option fails (i.e. is about to output "-") then a fallback procedure could be undertaken. Anyway, just committed and pushed my working version to this mirror.
I'm not sure how to handle this issue. This is certainly a corner case and of low importance I guess.
Fixing udev is unrealistic and there's far too many users of /dev/disk/by-id
that rely on similar way of enumeration to match the device<->identifier pair. Since lsscsi depends on udev already (and related udev rules), it might make sense to use udev db (through bindings) directly. That's quite a bit of work though.
There's a known design shortcoming related to udev and symlinks where symlinks get randomly overwritten in case of duplicate identifiers. This for example concerns
/dev/disk/by-XXX
that is heavily used by lsscsi for enumeration. As a result identifiers may be missing in its output for some devices.The test case for example is as follows:
Running
udevadm trigger
will regenerate the symlinks in different (random) order, resulting in the same number of missing identifiers on different devices each time.Any suggestion for a workaround avoiding drastic changes to the lsscsi enumeration code?