svn commit: r251649 - in head/sys/cam: ata scsi

Kenneth D. Merry ken at FreeBSD.org
Wed Jun 12 17:01:27 UTC 2013


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 at FreeBSD.ORG


More information about the svn-src-all mailing list