From owner-freebsd-bugs Sun Mar 17 21:40:02 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id VAA00667 for bugs-outgoing; Sun, 17 Mar 1996 21:40:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id VAA00661 Sun, 17 Mar 1996 21:40:01 -0800 (PST) Date: Sun, 17 Mar 1996 21:40:01 -0800 (PST) Message-Id: <199603180540.VAA00661@freefall.freebsd.org> To: freebsd-bugs Cc: From: Bruce Evans Subject: Re: kern/1087: Device close entry is not called when unmounting UFS. Reply-To: Bruce Evans Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk The following reply was made to PR kern/1087; it has been noted by GNATS. From: Bruce Evans To: FreeBSD-gnats-submit@freebsd.org, akiyama@kme.mei.co.jp Cc: dyson@freebsd.org Subject: Re: kern/1087: Device close entry is not called when unmounting UFS. Date: Mon, 18 Mar 1996 16:31:54 +1100 > In sys/miscfs/specfs/spec_vnops.c:spec_close(), the case of > VBLK, vcount() always returns 2 even if the last close. Then > device close entry never called from spec_close() function. >>Fix: > > I don't know why vcount() returns 2 at last close, so I > beleive this is not a ture fix. vn_vmio holds a reference. See ffs_unmount() and vn_close(). Perhaps the correct fix is to move the vn_vmio_close() before the VOP_CLOSE()? WHere does the reference count get incremented for the non-VREG case of vn_open()? vn_close() releases a reference in all cases. >--- sys/miscfs/specfs/spec_vnops.c-dist Tue Jan 2 05:20:45 1996 >+++ sys/miscfs/specfs/spec_vnops.c Mon Mar 18 10:52:36 1996 >@@ -625,7 +625,7 @@ > * sum of the reference counts on all the aliased > * vnodes descends to one, we are on last close. > */ >- if (vcount(vp) > 1 && (vp->v_flag & VXLOCK) == 0) >+ if (vcount(vp) > 2 && (vp->v_flag & VXLOCK) == 0) > return (0); > devclose = bdevsw[major(dev)]->d_close; > mode = S_IFBLK; Bruce