> Date: Mon, 23 Jun 2003 21:11:35 +0300 (EEST)
> From: Tuukka Toivonen <[EMAIL PROTECTED]>

> >> If usb_disconnect() can happen while already executing in open(), and if
> >> the former frees the data structures used by the driver, then the latter
> >> call might continue working with already freed memory region which could
> >> lead to catastrophe.
> >
> >This is why God has given you semaphores, spinlocks, and
> >reference counts.

> So I can not think of any way to fix it... usb_disconnect() can not trust
> that the open() call has had time to do any locking, or anything. How can
> it know whether resources may be freed?

The open only gets filesystem related arguments. Everything USB
related is retrieved from functions, and you can lock around that.
The disconnect method cannot free an inode or a file which
are being passed to open. It only has to lock USB stuff,
such as buses, devices, etc.

-- Pete


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to