From owner-cvs-src@FreeBSD.ORG Fri Nov 18 18:11:12 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 580EF16A41F; Fri, 18 Nov 2005 18:11:12 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id D514043D45; Fri, 18 Nov 2005 18:11:11 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.14] (imini.samsco.home [192.168.254.14]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id jAIIB9nw000282; Fri, 18 Nov 2005 11:11:10 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <437E193D.2090205@samsco.org> Date: Fri, 18 Nov 2005 11:11:09 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.7) Gecko/20050416 X-Accept-Language: en-us, en MIME-Version: 1.0 To: John Polstra References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on pooker.samsco.org Cc: cvs-src@FreeBSD.org, Poul-Henning Kamp , src-committers@FreeBSD.org, Lukas Ertl , 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 X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2005 18:11:12 -0000 John Polstra wrote: > 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 Ok, I understand. I'm not sure if I have a better solution, but it is something that I'll be looking at in the future. Thanks for the explaination. Scott