From owner-freebsd-current Wed Oct 24 12: 0: 6 2001 Delivered-To: freebsd-current@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id 7B58B37B401 for ; Wed, 24 Oct 2001 12:00:01 -0700 (PDT) Received: (from dillon@localhost) by apollo.backplane.com (8.11.6/8.9.1) id f9OIxqs97073; Wed, 24 Oct 2001 11:59:52 -0700 (PDT) (envelope-from dillon) Date: Wed, 24 Oct 2001 11:59:52 -0700 (PDT) From: Matthew Dillon Message-Id: <200110241859.f9OIxqs97073@apollo.backplane.com> To: Jonathan Lemon Cc: Jun Kuriyama , David Wolfskill , Jonathan Lemon , Current Subject: Re: panic: vrele: missed vn_close References: <200110230121.f9N1LTa24181@freefall.freebsd.org> <7mg089l1bn.wl@waterblue.imgsrc.co.jp> <200110241838.f9OIcCR96868@apollo.backplane.com> <20011024135503.C75389@prism.flugsvamp.com> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG : :Hmm. The way the revamped console code works is this: : : cn_devopen() calls vn_open() to open the device. If this is not a :VCHR device, then it is closed. Otherwise, the vnode is stashed in :cnd->cnd_vp. : : When the device is closed though cnclose(), it walks through a list :of console devices, and if cnd_vp != NULL, calls vn_close() for that :vnode, and then NULLs out cnd_vp. (drops the reference.) : : My understanding is that vn_open/vn_close will track the count of :outstanding references to the vnode, so this should be safe to do. :-- :Jonathan The panic is due to v_writecount not being properly adjusted. If a vnode is opened with FWRITE in vn_open(), then it must be closed with VWRITE in vn_close() or v_writecount will not be properly adjusted and cause the panic in question to occur later in vrele(). I suspect that this is the problem with the devfs/console code. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message