linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Neil Brown <neilb@suse.de>
Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>,
	Andrew Morton <akpm@osdl.org>, Ingo Molnar <mingo@elte.hu>,
	linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: md deadlock (was Re: 2.6.18-mm2)
Date: Mon, 02 Oct 2006 15:47:38 +0200	[thread overview]
Message-ID: <1159796858.28131.149.camel@taijtu> (raw)
In-Reply-To: <1159538597.28131.97.camel@taijtu>

On Fri, 2006-09-29 at 16:03 +0200, Peter Zijlstra wrote:
> On Fri, 2006-09-29 at 22:52 +1000, Neil Brown wrote:
> > On Friday September 29, a.p.zijlstra@chello.nl wrote:
> > > On Thu, 2006-09-28 at 13:54 +0200, Michal Piotrowski wrote:
> > > 
> > > Looks like a real deadlock here. It seems to me #2 is the easiest to
> > > break.
> > 
> > I guess it could deadlock if you tried to add /dev/md0 as a component
> > of /dev/md0.  I should probably check for that somewhere.
> > In other cases the array->member ordering ensures there is no
> > deadlock.
> > 
> 
> 
> 	1					2
> 
>  open(/dev/md0)
> 
> 					open(/dev/md0)
> 					- do_open() -> bdev->bd_mutex
>  ioctl(/dev/md0, hotadd) 
>  - md_ioctl() -> mddev->reconfig_mutex
>  -- hot_add_disk()
>  --- bind_rdev_to_array()
>  ---- bd_claim_by_disk()
>  ----- bd_claim_by_kobject()
> 					-- md_open()
> 					--- mddev_lock()
> 					---- mutex_lock(mddev->reconfig_mutex)
>  ------ mutex_lock(bdev->bd_mutex)
> 

D'0h, 1:bdev->bd_mutex is ofcourse rdev->bd_mutex; the slave device's
mutex.

So mddev->bd_mutex wants to be another class all-together. 


  reply	other threads:[~2006-10-02 13:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060928014623.ccc9b885.akpm@osdl.org>
2006-09-28 11:54 ` 2.6.18-mm2 Michal Piotrowski
2006-09-29 12:12   ` md deadlock (was Re: 2.6.18-mm2) Peter Zijlstra
2006-09-29 12:52     ` Neil Brown
2006-09-29 14:03       ` Peter Zijlstra
2006-10-02 13:47         ` Peter Zijlstra [this message]
2006-10-10  3:53           ` Neil Brown
2006-10-10  6:42             ` Ingo Molnar

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=1159796858.28131.149.camel@taijtu \
    --to=a.p.zijlstra@chello.nl \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=michal.k.k.piotrowski@gmail.com \
    --cc=mingo@elte.hu \
    --cc=neilb@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).