9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@labs.coraid.com>
To: 9fans@9fans.net
Subject: Re: [9fans] interesting deadlock
Date: Fri, 17 Sep 2010 18:12:08 -0400	[thread overview]
Message-ID: <ba77339bbbbb714318b904a9951d7e49@coraid.com> (raw)
In-Reply-To: <AANLkTimUE_yx3W=8eHkL=JyFRvR+HfGD2b-O6zxCUoOX@mail.gmail.com>

On Thu, Sep 16, 2010 at 11:02 PM, erik quanstrom <quanstro@quanstro.net> wrote:
> i have these processes all deadlocked.  8.out
> is serving /n/mntpt.
>
> xxx        11921346    0:00   0:00      436K Create   8.out
> xxx        11921785    0:00   0:00       24K Open     cat /n/mntpt/sos
> xxx        11921786    0:00   0:00       24K Unmount  unmount /n/mntpt
> xxx        11921787    0:00   0:00       44K Pwrite   echo x y

okay, it's not.  sorry for the confusion.  the reason
for looking at that case was that it seemed at the
time related to a crash here on the indirection
of mh->mount, which is nil.  the code in question
was a fileserver which was crashing, getting killed
while concurrent io was being done to the fs.

/sys/src/9/port/chan.c:1009,1019
		if((wq = ewalk(c, nil, names+nhave, ntry)) == nil){
			/* try a union mount, if any */
			if(mh && !nomount){
				/*
				 * mh->mount->to == c, so start at mh->mount->next
				 */
				rlock(&mh->lock);
				for(f = mh->mount->next; f; f = f->next)
					if((wq = ewalk(f->to, nil, names+nhave, ntry)) != nil)
						break;

i don't know why it can't be nil, since the code here
doesn't have a lock.  i think this might be the solution,
but i haven't done a careful lock audit to be sure

/usr/quanstro/src/ysk/port/chan.c:1009,1021
		if((wq = ewalk(c, nil, names+nhave, ntry)) == nil){
			/* try a union mount, if any */
			if(mh && !nomount){
				/*
				 * mh->mount->to == c, so start at mh->mount->next
				 */
	>>			f = nil;
				rlock(&mh->lock);
	>>			if(mh->mount)
				for(f = mh->mount->next; f; f = f->next)
					if((wq = ewalk(f->to, nil, names+nhave, ntry)) != nil)
						break;
				runlock(&mh->lock);

- erik



  reply	other threads:[~2010-09-17 22:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-17  3:02 erik quanstrom
2010-09-17 21:11 ` Russ Cox
2010-09-17 22:12   ` erik quanstrom [this message]
2010-09-17 23:21     ` Russ Cox
2010-09-17 23:57   ` erik quanstrom

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=ba77339bbbbb714318b904a9951d7e49@coraid.com \
    --to=quanstro@labs.coraid.com \
    --cc=9fans@9fans.net \
    /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).