From owner-svn-src-head@FreeBSD.ORG Wed Jun 12 17:01:27 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 C148CB3B; Wed, 12 Jun 2013 17:01:27 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id 7B1B61F85; Wed, 12 Jun 2013 17:01:27 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id r5CH1QaD009247; Wed, 12 Jun 2013 11:01:26 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id r5CH1QXE009246; Wed, 12 Jun 2013 11:01:26 -0600 (MDT) (envelope-from ken) Date: Wed, 12 Jun 2013 11:01:26 -0600 From: "Kenneth D. Merry" To: Alexander Motin Subject: Re: svn commit: r251649 - in head/sys/cam: ata scsi Message-ID: <20130612170126.GA8081@nargothrond.kdm.org> References: <201306120907.r5C97FTN022047@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201306120907.r5C97FTN022047@svn.freebsd.org> User-Agent: Mutt/1.4.2i 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:01:27 -0000 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. 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.) Ken -- Kenneth Merry ken@FreeBSD.ORG