Bug 1297512

Summary: udev_enumerate_scan_devices() does not scan all devices
Product: Red Hat Enterprise Linux 7 Reporter: mulhern <amulhern>
Component: systemdAssignee: systemd-maint
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: systemd-maint-list
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-15 07:39:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1255191    
Attachments:
Description Flags
Very simple illustrative reproducer none

Description mulhern 2016-01-11 17:57:22 UTC
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().

Comment 1 mulhern 2016-01-11 18:00:12 UTC
Created attachment 1113645 [details]
Very simple illustrative reproducer

Comment 3 mulhern 2016-01-18 22:04:29 UTC
I notice that there has been a bit of thrashing around this code at least as early as last August, systemd commit 9a9c7dc2cbbe3c26cfbbcb02475d95ff3afe507e.

Comment 6 RHEL Program Management 2020-12-15 07:39:29 UTC
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.