lkml.org 
[lkml]   [2008]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH update] firewire: fix "kobject_add failed for fw* with -EEXIST"
Jarod Wilson wrote:
> Looks straight-forward enough, and I'll give these a spin shortly and see if I
> can reproduce the situation I was hitting with my raid array...

As far as the naming of devices is concerned, the bug and the necessary
fix are entirely obvious.

But the interaction with userspace processes opening /dev/fwX while the
respective node is being shut down gave me headaches. I am still not
entirely sure if I got it right in the patch update, i.e. if it is free
from deadlocks. fw_device_shutdown() and fw_device_op_open() can be
entered at the same time. Would device_unregister() have to acquire a
driver core lock which open() already took? If yes, device_unregister()
would be blocked on this lock while fw_device_op_open() is blocked on
idr_rwsem.

So why did I move device_unregister() into the idr_rwsem protected
section in the first place? That's because I wanted to guarantee that
fw_device_op_open() wouldn't look up a fw_device which is just in the
process of being unregistered. But maybe we don't even need this guarantee.

It would all be so easy if I knew how the driver core works. :-/
--
Stefan Richter
-=====-==--- ---= ===--
http://arcgraph.de/sr/


\
 
 \ /
  Last update: 2008-01-28 20:21    [W:1.493 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site