Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Mar 96 11:55:21 JST
From:      akiyama@kme.mei.co.jp
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/1087: Device close entry is not called when unmounting UFS.
Message-ID:  <9603180255.AA06758@kmegate.kme.mei.co.jp>
Resent-Message-ID: <199603180300.TAA24012@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         1087
>Category:       kern
>Synopsis:       Device close entry is not called when unmounting UFS.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 17 19:00:02 PST 1996
>Last-Modified:
>Originator:     Shunsuke Akiyama
>Organization:
Kyushu Matsushita Electric Co., Ltd.
>Release:        FreeBSD 2.2-960303-SNAP i386
>Environment:

	All FreeBSD-2.2-960303-SNAP systems configured with UFS
	(options FFS).

>Description:

	Device close entry is not called when unmounting UFS.  This is
	not occured in FreeBSD-2.1.0-RELEASE.  Device close entry like
	sd or od allow media ejecting in it.  Therefor the SCSI
	removable disk device can not ejected, if it once unmounted.

>How-To-Repeat:

	Every unmounting UFS.
	(I checked UFS on wd, fd, sd and od.)

	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.

--- 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;
>Audit-Trail:
>Unformatted:



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