udev: support by-path devlink for multipath nvme block devices
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 20 Sep 2022 17:26:42 +0000 (02:26 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 23 Sep 2022 01:21:46 +0000 (10:21 +0900)
commit67c3e1f63a5221b47a8fea85ae421671f29f3b7e
tree048dc12c3ede1f2b8917610d83bd327d84c3efd0
parent68f2134954098ff3b097704542f537fb9e9ef251
udev: support by-path devlink for multipath nvme block devices

If multipath feature is enabled, nvme block devices may belong to the
"nvme-subsystem" subsystem, instead of "nvme" subsystem.
(What a confusing name...)

Then, the syspath is something like the following,
    /sys/devices/virtual/nvme-subsystem/nvme-subsys0/nvme0n1
Hence, we need to find the 'real parent' device, such as
    /sys/devices/pci0000:00/0000:00:1c.4/0000:3c:00.0/nvme/nvme0

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2031810.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2124964.
Replaces #24748.
rules.d/60-persistent-storage.rules
src/udev/udev-builtin-path_id.c