All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ftp.linux.org.uk>
To: Andrew Morton <akpm@osdl.org>
Cc: Dave Peterson <dsp@llnl.gov>,
	alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org,
	bluesmoke-devel@lists.sourceforge.net
Subject: Re: [PATCH 13/15] EDAC: kobject/sysfs fixes
Date: Fri, 3 Mar 2006 02:44:03 +0000	[thread overview]
Message-ID: <20060303024403.GA27946@ftp.linux.org.uk> (raw)
In-Reply-To: <20060302183153.452f93d9.akpm@osdl.org>

On Thu, Mar 02, 2006 at 06:31:53PM -0800, Andrew Morton wrote:
> Dave Peterson <dsp@llnl.gov> 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.

      reply	other threads:[~2006-03-03  2:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-03  1:48 [PATCH 13/15] EDAC: kobject/sysfs fixes Dave Peterson
2006-03-03  2:31 ` Andrew Morton
2006-03-03  2:44   ` Al Viro [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060303024403.GA27946@ftp.linux.org.uk \
    --to=viro@ftp.linux.org.uk \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bluesmoke-devel@lists.sourceforge.net \
    --cc=dsp@llnl.gov \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.