Bug 1295979

Summary: udev_enumerate_scan_devices() broken when used with udev_enumerate_add_match_parent()
Product: [Fedora] Fedora Reporter: Christian Krause <chkr>
Component: systemdAssignee: systemd-maint
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: johannbg, jsynacek, lnykryn, msekleta, muhammad.saad, s, systemd-maint, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: systemd-222-12.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-10 19:24:10 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:
Embargoed:
Attachments:
Description Flags
Small C program which demonstrates the problem. none

Description Christian Krause 2016-01-06 00:15:19 UTC
Created attachment 1111983 [details]
Small C program which demonstrates the problem.

Description of problem:
When I boot my system having the USB printer already attached I see the following error messages in syslog:

udev-configure-printer[1339]: add usb-003-005
udev-configure-printer[1339]: device devpath is /devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.6
udev-configure-printer[1339]: udev_enumerate_scan_devices failed

The root cause is in systemd's libudev:
https://github.com/systemd/systemd/commit/9a9c7dc2cbbe3c26cfbbcb02475d95ff3afe507e

At least in version 222, udev_enumerate_scan_devices() does not work properly together with udev_enumerate_add_match_parent().

Version-Release number of selected component (if applicable):
systemd-libs-222-10.fc23.x86_64

How reproducible:
100%

Steps to reproduce:
- either have a supported USB printer attached at bootup or alternatively use the attached test program to check for the API misbehaviour:

1. gcc -Wall -o udev_test udev_test.c -ludev
2. ./udev_test /sys/bus/usb/devices/3-1.6

Actual results:
udev scan_devices returned: -2

Expected results:
Device Path: /sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.6
Device Path: /sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.6/3-1.6:1.0
Device Path: /sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.6/3-1.6:1.0/usbmisc/lp0

Additional info:
The bug is already fixed in systemd-228:

https://github.com/systemd/systemd/commit/9a9c7dc2cbbe3c26cfbbcb02475d95ff3afe507e

Please consider to cherry-pick this commit also for Fedora 23.

Comment 1 Fedora Update System 2016-01-08 09:47:48 UTC
systemd-222-12.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-aae4b3b916

Comment 2 Fedora Update System 2016-01-09 04:27:10 UTC
systemd-222-12.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-aae4b3b916

Comment 3 Fedora Update System 2016-01-10 19:23:56 UTC
systemd-222-12.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.