Bug 9828 - firewire-core: "kobject_add failed for fw5 with -EEXIST"
Summary: firewire-core: "kobject_add failed for fw5 with -EEXIST"
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: IEEE1394 (show other bugs)
Hardware: All Linux
: P1 low
Assignee: Stefan Richter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-26 14:58 UTC by Stefan Richter
Modified: 2008-02-28 02:24 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.22, 2.6.23, 2.6.24
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

Description Stefan Richter 2008-01-26 14:58:39 UTC
There are race conditions in the handling of drivers/firewire/fw-device.c::fw_device_idr which lead to firewire-core attempting to add new devices with same name as existing devices.  This notably happens if a device is being shut down with error conditions and a new device is being created at the same time.  See the WARNING in http://bugzilla.kernel.org/attachment.cgi?id=14580 for an example.

Both fw_device_init() and fw_device_shutdown() call idr_remove() too early.

Impact of the bug:  Happens rarely, forces the user to unplug and replug the new device to get it working.
Comment 1 Stefan Richter 2008-01-26 15:30:35 UTC
Correction: fw_device_init() looks fine, because only the code after successful device_add() matters.
Comment 2 Stefan Richter 2008-01-26 16:10:05 UTC
proposed patch: http://lkml.org/lkml/2008/1/26/228
Comment 3 Stefan Richter 2008-02-17 04:37:11 UTC
patch last updated on February 2: http://lkml.org/lkml/2008/2/2/108
committed to linux1394-2.6.git
planned to be submitted to mainline before 2.6.25
Comment 4 Stefan Richter 2008-02-28 02:24:29 UTC
fix merged by Linus

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