Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Mar 1996 21:40:01 -0800 (PST)
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs
Subject:   Re: kern/1087: Device close entry is not called when unmounting UFS.
Message-ID:  <199603180540.VAA00661@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/1087; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199603180540.VAA00661>