Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Nov 2005 10:09:09 -0800 (PST)
From:      John Polstra <jdp@polstra.com>
To:        Scott Long <scottl@samsco.org>
Cc:        cvs-src@FreeBSD.org, Poul-Henning Kamp <phk@phk.freebsd.dk>, src-committers@FreeBSD.org, Lukas Ertl <le@FreeBSD.org>, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/cam/scsi scsi_cd.c scsi_da.c src/sys/geom geom_disk.c geom_disk.h geom_subr.c
Message-ID:  <XFMail.20051118100909.jdp@polstra.com>
In-Reply-To: <437DFA34.8040308@samsco.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 18-Nov-2005 Scott Long wrote:
> Poul-Henning Kamp wrote:
>> In message <437DEEE5.9040201@samsco.org>, Scott Long writes:
>> 
>>>Poul-Henning Kamp wrote:
>> 
>> 
>>>>Most drivers seem to detach their internal state from the struct
>>>>disk, and therefore they don't need this.
>>>>
>>>
>>>So what makes CAM special in this regard?
>> 
>> 
>> I dunno.  Cam seems to have a different lifecycle for devices
>> but I have never dived deep enough to figure it out.
>> 
> 
> Ok.  John's fix seems hackish (no offense John).  I'll likely look at
> this in the coming months.

No offense taken, Scott. :-)

I think what makes CAM special is that it reference counts all of its
data structures, so they don't go away until the last close of the
device even though the drive itself is long gone.  In particular,
dacleanup() isn't called until the last close, and it's what calls
disk_destroy().  Geom needs to know when the physical drive is gone,
not when CAM decides it can free its associated data structures.  The
disk_gone() idea was suggested by PHK, and it seems reasonable to me.
But I've still got a lot to learn about both CAM and geom, so if you
can come up with something better, then that would be great.

John



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20051118100909.jdp>