From owner-svn-src-head@FreeBSD.ORG Wed Jun 12 17:39:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AFF93A1B; Wed, 12 Jun 2013 17:39:54 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ea0-x235.google.com (mail-ea0-x235.google.com [IPv6:2a00:1450:4013:c01::235]) by mx1.freebsd.org (Postfix) with ESMTP id C2BAE1322; Wed, 12 Jun 2013 17:39:53 +0000 (UTC) Received: by mail-ea0-f181.google.com with SMTP id a15so4744646eae.26 for ; Wed, 12 Jun 2013 10:39:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=KaHidGR7evbj7a9f54tLFaqFBISmqBg3psPZ8KSuDxo=; b=yREwslADwernxyyX857EIpb6OH9tqrpsPYVG07DsYFwZz92Qv+89ml8/y+TbNVqEtF oqUjQTclZhGzOqesqKGL4xhTsSR6c9F0w/48pq+c7Yp5PpAFeOCnnqZ0AXOTE8PlXsdi 1Dzcnwb0vv1ZHa1fqDAY87Rw2RWOTCxvyCD1BzoDvIGy9HmR23qpL7DgNUfghfcKF8d8 x1kFykF0Ag0u2Oj3N/bV1cVGqM710lDCI41TFMzImegYVyKjW+7PgVMfTGL6r4B0TGwu ieWMHkC1Tm+P7+6+KNsn4dMwzLlQqHLqUJz5ckn98aXvWFhddJUdoGOsIsVa8Ik8lSq1 uEiQ== X-Received: by 10.14.4.130 with SMTP id 2mr11750847eej.96.1371058792889; Wed, 12 Jun 2013 10:39:52 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPSA id s8sm38312296eeo.4.2013.06.12.10.39.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Jun 2013 10:39:51 -0700 (PDT) Sender: Alexander Motin Message-ID: <51B8B265.8010306@FreeBSD.org> Date: Wed, 12 Jun 2013 20:39:49 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130413 Thunderbird/17.0.5 MIME-Version: 1.0 To: "Kenneth D. Merry" Subject: Re: svn commit: r251649 - in head/sys/cam: ata scsi References: <201306120907.r5C97FTN022047@svn.freebsd.org> <20130612170126.GA8081@nargothrond.kdm.org> In-Reply-To: <20130612170126.GA8081@nargothrond.kdm.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 12 Jun 2013 17:39:54 -0000 On 12.06.2013 20:01, Kenneth D. Merry wrote: > On Wed, Jun 12, 2013 at 09:07:15 +0000, Alexander Motin wrote: >> Author: mav >> Date: Wed Jun 12 09:07:15 2013 >> New Revision: 251649 >> URL: http://svnweb.freebsd.org/changeset/base/251649 >> >> Log: >> Acquire periph reference when handling d_getattr() method call. >> >> While GEOM in general has provider opened while sending BIO_GETATTR, >> GEOM DISK does not really need to open disk to read medium-unrelated >> attributes for own use. >> >> Proposed by: ken > > I forgot proposing that, but it seems like we probably don't need to > acquire a reference there. Ah, may be for this point it still was Justin. Sorry, if so. > The primary thing we want to insure is that the > peripheral is valid and doesn't go away. We acquire a reference when we do > the disk_create(), and then release that reference when our GEOM provider > has gone away. (GEOM calls the d_gone() callback, and so we know that it > will not call into the CAM peripheral driver again.) > > I assume that once the provider has gone away, there won't be any more > d_getattr() method calls. If so, the existing reference should be enough > to protect it. (If we can get d_getattr() calls after the provider has > gone away, then that needs to be fixed.) You seems to be right. I've forgot about that d_gone() method. It wasn't there in original design. Then probably we don't need reference counting on d_open()/d_close() either any more. -- Alexander Motin