From owner-freebsd-current Thu Nov 28 14:13:18 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 9B80337B401 for ; Thu, 28 Nov 2002 14:13:17 -0800 (PST) Received: from angelica.unixdaemons.com (angelica.unixdaemons.com [209.148.64.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id 16DC243E4A for ; Thu, 28 Nov 2002 14:13:16 -0800 (PST) (envelope-from hiten@angelica.unixdaemons.com) Received: from angelica.unixdaemons.com (hiten@localhost.unixdaemons.com [127.0.0.1]) by angelica.unixdaemons.com (8.12.5/8.12.1) with ESMTP id gASMD6Su079461; Thu, 28 Nov 2002 17:13:06 -0500 (EST) X-Authentication-Warning: angelica.unixdaemons.com: Host hiten@localhost.unixdaemons.com [127.0.0.1] claimed to be angelica.unixdaemons.com Received: (from hiten@localhost) by angelica.unixdaemons.com (8.12.5/8.12.1/Submit) id gASMD5bt079453; Thu, 28 Nov 2002 17:13:05 -0500 (EST) (envelope-from hiten) Date: Thu, 28 Nov 2002 17:13:05 -0500 From: Hiten Pandya To: Ian Dowse Cc: Bruce Evans , "Vladimir B. Grebenschikov" , "current@freebsd.org" Subject: Re: MD broken in current Message-ID: <20021128221305.GA78829@angelica.unixdaemons.com> References: <20021127215253.G7621-100000@gamplex.bde.org> <200211271137.aa77228@salmon.maths.tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200211271137.aa77228@salmon.maths.tcd.ie> User-Agent: Mutt/1.4i X-Operating-System: FreeBSD i386 X-Public-Key: http://www.pittgoth.com/~hiten/pubkey.asc X-URL: http://www.unixdaemons.com/~hiten X-PGP: http://pgp.mit.edu:11371/pks/lookup?search=Hiten+Pandya&op=index 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, Nov 27, 2002 at 11:37:17AM +0000, Ian Dowse wrote the words in effect of: > In message <20021127215253.G7621-100000@gamplex.bde.org>, Bruce Evans writes: > >On Wed, 27 Nov 2002, Ian Dowse wrote: > >> I think moving the line > >> > >> tsleep(sc, PRIBIO, "mdwait", 0); > >> > >> to just after the following `if' statement may do the trick. If the > > > >Wouldn't Giant locking prevent races here? There is no locking in > >sight for the ioctl, but ioctl() holds Giant. > > Yes, but mddestroy() assumes that the kthread is waiting in the > "mdwait" tsleep() when it calls wakeup(). That won't be true if the > kthread has not yet had a chance to run, or if it is waiting to > acquire Giant before entering the main loop (or if anything it calls > drops Giant). Moving the check of the MD_SHUTDOWN to before the > tsleep should catch all of these cases, and Giant ensures that the > wakeup() does not occur after the flag is tested but before the > tsleep(). > Is anyone planning to take this task, because, I think its important that it is fixed. Or should it be put on the 5.0-todo list? If not, we should put it in the BUGS section of mdconfig/ or the md(4) manual page. IMO. -- Hiten Pandya (hiten@unixdaemons.com, hiten@uk.FreeBSD.org) http://www.unixdaemons.com/~hiten/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message