Red Hat Bugzilla – Bug 1255191
udev_enumerate_add_match_parent() results does not include device
Last modified: 2018-02-14 18:05:24 EST
Created attachment 1065019 [details]
Simple little test file
Description of problem:
The documentation (https://www.kernel.org/pub/linux/utils/kernel/hotplug/libudev/libudev-udev-enumerate.html#udev-enumerate-add-match-parent) specifies that the parent argument should be included in the result. But, in some cases, it is not.
Version-Release number of selected component (if applicable):
Always reproducible for certain devices.
Steps to Reproduce:
1. Compile and execute the attached file on my machine.
2. Examine the output, and notice that "/sys/devices/system/memory" is not
-- alternatively, run python-pyudev test suite and hope to see a few failures
Parent is not included.
Parent is included.
This came to light while I was running the python-pyudev test-suite, but the
bug is in libudev.
Problem also occurs in systemd (219).
Perhaps this is a documentation bug? But, at some point, the statement in the documentation was true, and now it is false.
I believe that this bz is connected with bz#1297512, and is really just another expression of it. If a device has no subsystem, then it does not appear in the result of match_parent() on itself.
udev_enumerate_add_match_parent() did include the device, even if subsystem missing, in systemd version 175.