From owner-svn-src-all@FreeBSD.ORG Thu May 21 13:55:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A56F1065675; Thu, 21 May 2009 13:55:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 09C8E8FC16; Thu, 21 May 2009 13:55:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id B38E946B06; Thu, 21 May 2009 09:55:22 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id AAB3C8A025; Thu, 21 May 2009 09:55:21 -0400 (EDT) From: John Baldwin To: Attilio Rao Date: Thu, 21 May 2009 09:42:34 -0400 User-Agent: KMail/1.9.7 References: <200905211322.n4LDM73t067924@svn.freebsd.org> <20090521132641.GJ1927@deviant.kiev.zoral.com.ua> <3bbf2fe10905210629p46c7a204v6863aaba77354462@mail.gmail.com> In-Reply-To: <3bbf2fe10905210629p46c7a204v6863aaba77354462@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905210942.35555.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 21 May 2009 09:55:21 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Kostik Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r192535 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 13:55:23 -0000 On Thursday 21 May 2009 9:29:57 am Attilio Rao wrote: > 2009/5/21 Kostik Belousov : > > On Thu, May 21, 2009 at 01:22:07PM +0000, Attilio Rao wrote: > >> Author: attilio > >> Date: Thu May 21 13:22:07 2009 > >> New Revision: 192535 > >> URL: http://svn.freebsd.org/changeset/base/192535 > >> > >> Log: > >> Move the M_WAITOK flag in notify() into an M_NOWAIT one in order to match > >> the behaviour alredy present with the further malloc() call in > >> devctl_notify(). > >> This fixes a bug in the CAM layer where the camisr handler finished to > >> call camperiphfree() (and subsequently destroy_dev() resulting in a new > >> dev notify) while the xpt lock is held. > > This is wrong. You cannot call destroy_dev() while holding any mutex. > > Taking this into account, it makes no sense to use M_NOWAIT in notify(). > > As long as devctl_notify() also calls M_NOWAIT and if not available > skips "silently" it just does the same thing, I think this approach is > more consistent. > > It remains, though, the fact to fix CAM when calling destroy_dev(). > Maybe we should add a witness_warn() there? I agree with kib, this should be reverted and CAM fixed instead. I also agree that M_NOWAIT use should be limited where possible. -- John Baldwin