From owner-freebsd-hackers Thu Feb 3 13:16:47 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from gvr.gvr.org (gvr.gvr.org [194.151.74.97]) by builder.freebsd.org (Postfix) with ESMTP id 8BB1443F6; Thu, 3 Feb 2000 13:16:36 -0800 (PST) Received: by gvr.gvr.org (Postfix, from userid 657) id 58812A85B; Thu, 3 Feb 2000 22:14:24 +0100 (CET) Date: Thu, 3 Feb 2000 22:14:24 +0100 From: Guido van Rooij To: "Kenneth D. Merry" Cc: freebsd-hackers@FreeBSD.ORG, freebsd-current@freebsd.org Subject: bug in vn, a pnaic and how to debug modules (was Re: open ref counts in CAM and vn) Message-ID: <20000203221424.A66443@gvr.gvr.org> References: <20000203102615.A64986@gvr.gvr.org> <20000203100522.A52825@panzer.kdm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.6i In-Reply-To: <20000203100522.A52825@panzer.kdm.org>; from Kenneth D. Merry on Thu, Feb 03, 2000 at 10:05:22AM -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Feb 03, 2000 at 10:05:22AM -0700, Kenneth D. Merry wrote: > > 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. ok. > > I don't know about the vn device, though. > That was the reason fro the posting. vnconfig -u goes directly to the vn device but that device has no track of open count. I don't see any code to notify the upper layer that the device is gove. That is wrong of course. In fact, one can vnconfig -u a device, while the device is used in a mount. The ufs layer doesn't even know that the device is gone and accessing the mount is still possible. Unmounting is not. So in this case, I guess vnconfig -u should fail. I think this is best achieved by using a ref counter in the vn device code. There is another bug in the vn code as well, which has tom do with modules. The following will panic on a page fault in vnsetcred (in the VOP_UNLOCK call): kldload vn vnconfig -c something vnconfig -u something kldunload vn kldload vn vnconfig -c something <--- instant panic I have not been able to debug this further, because it seems (but I have to recheck to be sure), that add-symbol-file /modules/vn does not allow one to look at variables delcared inside the vn module. Is there an easy way btw to determine
? I looked inside the debugger in the linker_files queue and then use the load address there, plus the start address of .text as found by objdump of the vn module. -Guido To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message