mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Kevin Winchester <kjwinchester@gmail.com>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	Arjan van de Ven <arjan@linux.intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	NetDev <netdev@vger.kernel.org>,
	gregkh@suse.de
Subject: Re: Top 10 kernel oopses for the week ending January 5th, 2008
Date: Mon, 14 Jan 2008 12:36:10 +1100	[thread overview]
Message-ID: <18314.48266.220382.180206@notabene.brown> (raw)
In-Reply-To: message from Al Viro on Thursday January 10

On Thursday January 10, viro@ZenIV.linux.org.uk wrote:
> On Thu, Jan 10, 2008 at 03:13:48PM +1100, Neil Brown wrote:
> > > What guarantees that it doesn't happen before we get to callback?  AFAICS,
> > > nothing whatsoever...
> > 
> > Yes, that's bad isn't it :-)
> > 
> > I think I should be using sysfs_schedule_callback here.  That makes the 
> > required 'get' and 'put' calls.... but it can fail with -ENOMEM.  I
> > wonder what I do if -ENOMEM???  Maybe I'll just continue to roll my
> > one :-( 
> 
> How about this instead (completely untested)
> 
> 	* split failure exits
> 	* switch to kick_rdev_from_array()
> 	* fold unbind_rdev_from_array() into it (no other callers anymore)
> 	* take export_rdev() into failure case in bind_rdev_to_array()
> 	* in kick_rdev_from_array() do what export_rdev() does sans
> kobject_put() and do that before schedule_work().  Take kobject_put() into
> delayed_delete().

While there are probably some good ideas in there, I think fixing this
particular bug is much simpler.  Just take a reference to the object
before scheduling the worker, and drop it when the worker has done
its work.

I have a closer look at the idea of no required export_rdev after a
failed bind_rdev_to_array.  On the surface it does seem to make the
code nicer.

Thanks,
NeilBrown

  reply	other threads:[~2008-01-14  1:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-05 21:06 Arjan van de Ven
2008-01-05 21:26 ` Al Viro
2008-01-05 21:39 ` Al Viro
2008-01-07 17:44   ` J. Bruce Fields
2008-01-08  1:19     ` Kevin Winchester
2008-01-08  3:26       ` Linus Torvalds
2008-01-08  5:59         ` Al Viro
2008-01-08  7:33           ` Jarek Poplawski
2008-01-10  4:13           ` Neil Brown
2008-01-10  5:53             ` Al Viro
2008-01-14  1:36               ` Neil Brown [this message]
2008-01-08 16:14         ` Randy Dunlap
2008-01-08 17:42           ` Arjan van de Ven
2008-01-08 18:08             ` Linus Torvalds
2008-01-08 18:16               ` Arjan van de Ven
2008-01-08 18:27                 ` Linus Torvalds
2008-01-08 19:05                   ` Arjan van de Ven
2008-01-08 19:31                     ` Linus Torvalds
2008-01-08 22:56                       ` Rafael J. Wysocki
2008-01-08 17:08         ` Andi Kleen
2008-01-06  3:30 ` Andi Kleen
2008-01-06  3:31   ` Arjan van de Ven
2008-01-06  3:50     ` Andi Kleen
2008-01-09 14:12 ` Johannes Berg
2008-01-09 15:28   ` Arjan van de Ven

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=18314.48266.220382.180206@notabene.brown \
    --to=neilb@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@linux.intel.com \
    --cc=bfields@fieldses.org \
    --cc=gregkh@suse.de \
    --cc=kjwinchester@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®