Bug 1297512 - udev_enumerate_scan_devices() does not scan all devices
udev_enumerate_scan_devices() does not scan all devices
Status: NEW
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: systemd-maint
Depends On:
Blocks: 1255191
  Show dependency treegraph
Reported: 2016-01-11 12:57 EST by mulhern
Modified: 2018-02-14 18:06 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Very simple illustrative reproducer (1.48 KB, text/plain)
2016-01-11 13:00 EST, mulhern
no flags Details

  None (edit)
Description mulhern 2016-01-11 12:57:22 EST
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):


How reproducible:


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().
Comment 1 mulhern 2016-01-11 13:00 EST
Created attachment 1113645 [details]
Very simple illustrative reproducer
Comment 3 mulhern 2016-01-18 17:04:29 EST
I notice that there has been a bit of thrashing around this code at least as early as last August, systemd commit 9a9c7dc2cbbe3c26cfbbcb02475d95ff3afe507e.

Note You need to log in before you can comment on or make changes to this bug.