Hide Forgot
Description of problem: udev_enumerate_scan_devices() yields a list of devices which does not include some devices that can be found by other libudev methods. Version-Release number of selected component (if applicable): 219 How reproducible: Consistently. Steps to Reproduce: 1. Locate a disk device. 2. Use udev_device_get_parent to recursively discover the ancestors of the device until an ancestor is located that belongs to no subsystem. 3. Note that this devices is not among the devices that udev_enumerate_scan_devices yields. Actual results: Easy to find a device that is not in the list of devices yielded by udev_enumerate_scan_devices. Expected results: Just to be clear and consistent. Is udev_enumerate_scan_devices defined to yield only those devices that belong to some subsystem, and it's just the docs that are are not precise in stating this? Is it an error for a device to not belong to a subsystem? Should libudev not yield a parent that has no subsystem? Some code somewhere is wrong...but whose and where? Additional info: This also has consequences for procedures which filter on the list of devices, for instance, the results of udev_enumerate_add_match_subsystem and udev_enumerate_add_nomatch_subsystem would be expected to be complements, and thus to add up to all devices, but they don't. AFAIK, their union is equal to the result of udev_enumerate_scan_devices().
Created attachment 1113645 [details] Very simple illustrative reproducer
I notice that there has been a bit of thrashing around this code at least as early as last August, systemd commit 9a9c7dc2cbbe3c26cfbbcb02475d95ff3afe507e.
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release. Therefore, it is being closed. If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.