From owner-freebsd-current Wed Nov 27 2:50:28 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8C13D37B401 for ; Wed, 27 Nov 2002 02:50:27 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5BC1343E4A for ; Wed, 27 Nov 2002 02:50:26 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id VAA27382; Wed, 27 Nov 2002 21:49:56 +1100 Date: Wed, 27 Nov 2002 22:03:33 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Ian Dowse Cc: Hiten Pandya , "Vladimir B. Grebenschikov" , "current@freebsd.org" Subject: Re: MD broken in current In-Reply-To: <200211271010.aa45800@salmon.maths.tcd.ie> Message-ID: <20021127215253.G7621-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 27 Nov 2002, Ian Dowse wrote: > In message <20021127181557.V6874-100000@gamplex.bde.org>, Bruce Evans writes: > >Better fix mddestroy(). I don't know why it hangs ... I guess it is > >because it is called before initialization is completed in mdinit(), > >and there aren't enough state checks in mddestroy(). > > I think moving the line > > tsleep(sc, PRIBIO, "mdwait", 0); > > to just after the following `if' statement may do the trick. If the > wakeup() from mddestroy() comes in before md_kthread() gets to the > main loop, then it would be missed. I think jhb posted a better way > of synchronising with kthreads during their destruction, but I > haven't found the time to look into that yet. Wouldn't Giant locking prevent races here? There is no locking in sight for the ioctl, but ioctl() holds Giant. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message