From owner-freebsd-bugs Sun Mar 17 19:00:04 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id TAA24025 for bugs-outgoing; Sun, 17 Mar 1996 19:00:04 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id TAA24012 Sun, 17 Mar 1996 19:00:03 -0800 (PST) Resent-Date: Sun, 17 Mar 1996 19:00:03 -0800 (PST) Resent-Message-Id: <199603180300.TAA24012@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, akiyama@kme.mei.co.jp Received: from vcgate1.mei.co.jp (vcgate1.mei.co.jp [202.32.14.51]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id SAA23873 for ; Sun, 17 Mar 1996 18:56:18 -0800 (PST) Received: by vcgate1.mei.co.jp (5.65mei1.2g/5.9:4.9:vcgate0:960311) id AA22342; Mon, 18 Mar 96 11:57:41 +0900 Received: by vcmei.vanc.mei.co.jp (5.65mei1.1/5.9:4.9:vcmei:960229) id AA16685; Mon, 18 Mar 96 11:54:04 +0900 Received: by kmegate.kme.mei.co.jp (4.1/5.5:4.6:kmegate:960308) id AA06758; Mon, 18 Mar 96 11:55:21 JST Message-Id: <9603180255.AA06758@kmegate.kme.mei.co.jp> Date: Mon, 18 Mar 96 11:55:21 JST From: akiyama@kme.mei.co.jp Reply-To: akiyama@kme.mei.co.jp To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/1087: Device close entry is not called when unmounting UFS. Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >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: