Am Mittwoch, 3. September 2003 17:59 schrieb Greg KH:
> On Wed, Sep 03, 2003 at 01:19:39PM +0200, Oliver Neukum wrote:
> > Am Dienstag, 2. September 2003 22:09 schrieb Greg KH:
> > > ChangeSet 1.1276.1.66, 2003/08/29 14:39:40-07:00, [EMAIL PROTECTED]
> > > 
> > > [PATCH] USB: usb-skeleton bugfix
> > > 
> > > 
> > >  drivers/usb/usb-skeleton.c |    2 +-
> > >  1 files changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > 
> > > diff -Nru a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
> > > --- a/drivers/usb/usb-skeleton.c  Tue Sep  2 12:42:26 2003
> > > +++ b/drivers/usb/usb-skeleton.c  Tue Sep  2 12:42:26 2003
> > > @@ -295,7 +295,7 @@
> > >   if (atomic_read (&dev->write_busy))
> > >           wait_for_completion (&dev->write_finished);
> > >  
> > > - dev->open = 0;
> > > + --dev->open;
> > >  
> > >   if (!dev->present) {
> > >           /* the device was unplugged before the file was released */
> > 
> > No, this is very wrong. This is a release() method. It does _not_ correspond
> > to close(). Decrementing the usage count is absolutely _wrong_.
> > Please revert ASAP.
> 
> That's what I used to think too, but Juergen showed me some evidence
> otherwise.  Juergen, care to post the message you sent me detailing why
> you think this change was necessary?

As far as I can tell, the problem is that the reference count is not per
device, but per struct file. Thus you can get several calls to release()
for a single device. The question that needs to be answered is whether
the number of times release() is called is equal to the number of times
open() is called.
In any case, this is important. If skeleton is broken all drivers need to
be audited in this regard and a good solution needs to be found. I don't
like the idea of using a private counter.

        Regards
                Oliver



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to