From owner-freebsd-hackers Thu Feb 3 9: 6: 3 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from panzer.kdm.org (panzer.kdm.org [216.160.178.169]) by builder.freebsd.org (Postfix) with ESMTP id E43DB414E for ; Thu, 3 Feb 2000 09:05:55 -0800 (PST) Received: (from ken@localhost) by panzer.kdm.org (8.9.3/8.9.1) id KAA52872; Thu, 3 Feb 2000 10:05:22 -0700 (MST) (envelope-from ken) Date: Thu, 3 Feb 2000 10:05:22 -0700 From: "Kenneth D. Merry" To: Guido van Rooij Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: open ref counts in CAM and vn Message-ID: <20000203100522.A52825@panzer.kdm.org> References: <20000203102615.A64986@gvr.gvr.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20000203102615.A64986@gvr.gvr.org>; from guido@gvr.org on Thu, Feb 03, 2000 at 10:26:15AM +0100 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Feb 03, 2000 at 10:26:15 +0100, Guido van Rooij wrote: > A collegue fo mine had the problem that it was possible to > vnconfig -u a vn device that was currently in use. This strikes > me as odd. > When looking through the da device code, I notice a similar problem. > Suppose I have a zip fdisk mounted with a disklabel and 2 > ufs partitions on it. When I mount both partitions, the disk > will be locked. But it will be unlocked at the first unmount. > I guess there should be a refcounter that keeps track of > the amount of opens and only unlock devices at the last close. > > Same for vn.c. > > Any comments? The reference counting should be handled by PHK's disk layer (which sits above CAM), and the da driver's close routine should only get called on final close. I don't know about the vn device, though. Ken -- Kenneth Merry ken@kdm.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message