Re: [PATCH 13/15] EDAC: kobject/sysfs fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 02, 2006 at 06:31:53PM -0800, Andrew Morton wrote:
> Dave Peterson <[email protected]> wrote:
> >
> > - After we unregister a kobject, wait for our kobject release method
> >    to call complete().  This causes us to wait until the kobject
> >    reference count reaches 0.  Otherwise, a task accessing the EDAC
> >    sysfs interface can hold the reference count above 0 until after the
> >    EDAC module has been unloaded.  When the reference count finally
> >    drops to 0, this will result in an attempt to call our release
> >    method inside the EDAC module after the module has already been
> >    unloaded.
> 
> That's not really the way to do it.  If you have all the correct
> module_get()s and try_module_get()s and module_put()s in all the right
> places, kenrel/module.c:wait_for_zero_refcount() should do this for you.

Fundamentally, you _can't_ wait for sysfs references to go away when 
doing rmmod.  You can fail with -EBUSY, but waiting is an instant deadlock.
Why?  Because rmmod your_turd </sys/something_from_your_turd is going to
wait for itself to exit if you do that.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux