On Mon, 29 Mar 2004, Greg KH wrote: > On Sun, Mar 28, 2004 at 12:38:57PM -0800, Andrew Morton wrote: > > If so, what are its effects? rmmod hangs for half an hour? Cannot reload > > the module? > > Well, before the patch that I submitted for the USB core, we would hang > waiting for the release function to return as there was still a > reference to the kobject pending. > > For other subsystems (and USB), this might cause nasty oopses when the > kobject is finally released and yet the module has been unloaded already > (as the owner of the reference did not cause the module reference count > to increment.) This is bad. > > Maneesh, any thoughts on how to fix this up?
(Yes, I know I'm not Maneesh.) What's needed is for the reference to the kobject (and the pointer too, of course) to be dropped when the directory is deleted, even if the dentry isn't freed right away. That means sysfs has to be able to cope with dentrys whose d_fsdata pointer is NULL. Since erasing the pointer takes place while the dentry is locked, the rest of the code can safely assume that the kobject pointer will only go away when the dentry isn't locked locally. So it has to check the pointer each time it locks the dentry. Operations can simply be failed if the pointer isn't set. I'm not familiar enough with the extent of the sysfs routines to make such a change. However it doesn't seem like it would be all that difficult. Alan Stern ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
