From owner-svn-src-head@FreeBSD.ORG Thu May 21 13:29:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93DF8106566C; Thu, 21 May 2009 13:29:59 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-fx0-f168.google.com (mail-fx0-f168.google.com [209.85.220.168]) by mx1.freebsd.org (Postfix) with ESMTP id C94A38FC14; Thu, 21 May 2009 13:29:58 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by fxm12 with SMTP id 12so1073524fxm.43 for ; Thu, 21 May 2009 06:29:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=MyElVYwLe8841Z/XDsr+XK842PpylpcFn6LEPWCUv+E=; b=xlf4ZurhvFppwySPMXqd16orcryRHTEKhDg4zyT67iBL+z5MV773f2iP2OdApBRU/C 5SU+eaEcGA5dfNT5jlrnJ6tqYnmziMy3IxF/mGYVMJmnSM4hGxGm2xaYfWDKonJlvt1u MUpTNA+VQ4B3GaeiBcLKQCggULT2Mv66TXxdA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=cKU8db/bh6Ns5LxZsnaJD2K8dQcJ1F2kLfOMMessoUd6Pm1lnGiYFqVeFMnjQNkYKn pyI9A8hzlfctvX+rn3zZy0JgfW0mwzCgYyM0FFZv215/DbsONp1gm22TRzYijAbz1nPG AN/aid9gBqC9JP/sFW6tJkKqEXcbJxMs9XGUI= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.127.8 with SMTP id e8mr1649322fas.81.1242912597846; Thu, 21 May 2009 06:29:57 -0700 (PDT) In-Reply-To: <20090521132641.GJ1927@deviant.kiev.zoral.com.ua> References: <200905211322.n4LDM73t067924@svn.freebsd.org> <20090521132641.GJ1927@deviant.kiev.zoral.com.ua> Date: Thu, 21 May 2009 15:29:57 +0200 X-Google-Sender-Auth: 440f07f885932b26 Message-ID: <3bbf2fe10905210629p46c7a204v6863aaba77354462@mail.gmail.com> From: Attilio Rao To: Kostik Belousov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 13:30:00 -0000 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? Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein