Subject: kern/5589: SCSI Synchronize cache should be performed on final close.
To: None <gnats-bugs@gnats.netbsd.org>
From: Justin T. Gibbs <gibbs@NetBSD.ORG>
List: netbsd-bugs
Date: 06/14/1998 09:36:20
>Number:         5589
>Category:       kern
>Synopsis:       SCSI Synchronize cache should be performed on final close.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 14 09:50:00 1998
>Last-Modified:
>Originator:     Justin T. Gibbs
>Organization:
>Release:        NetBSD-current 980614
>Environment:
	Any machine running NetBSD current with SCSI disk devices.
System: NetBSD nb00 1.3E NetBSD 1.3E (ZHADUM) #3: Mon May 4 14:53:05 PDT 1998 thorpej@nb00:/ccd0/src/sys/arch/i386/compile/ZHADUM i386


>Description:
	In order for the SCSI Synchronize cache command to be effective in
all situations, it should be performed upon final close of the device.  This
ensures that all pending cache data is flushed to a media cartridge prior
to it's removal and also deals properly with devices in hot-plug enclosures
that may not see an "eject" event to know to flush the cache on their own.

>How-To-Repeat:
	Write some data to a disk in a hot-plug enclosure and remove it
quickly after final close.

>Fix:
	Perform final close at the same time that the "allow media removal"
command is performed in the sd driver.
>Audit-Trail:
>Unformatted: