Subject: kern/7211: st driver locks tape in drive for no-rewind device
To: None <gnats-bugs@gnats.netbsd.org>
From: Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us>
List: netbsd-bugs
Date: 03/22/1999 21:04:10
>Number:         7211
>Category:       kern
>Synopsis:       st driver locks tape in drive for no-rewind device
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 22 14:05:06 1999
>Last-Modified:
>Originator:     Bill Sommerfeld
>Organization:
	none
>Release:        19990322
>Environment:
	
System: NetBSD orchard.arlington.ma.us 1.3K NetBSD 1.3K (ORCHARDII) #43: Sat Mar 20 17:51:07 EST 1999 sommerfeld@orchard.arlington.ma.us:/usr/src/sys/arch/i386/compile/ORCHARDII i386


>Description:
	The scsi tape driver sets teh "prevent media removal" bit on
	open, but doesn't clear it on a close of the no-rewind device.
	(it does clear it on a close of the rewinding device).

>How-To-Repeat:
	For device which implements the "prevent media removal" bit:

	dump 0f /dev/nrst0 ...
	mt rewind

	try to remove tape from drive.

	This particularly messes up autochangers where the changer
	doesn't override the prevent bit and which are configured to
	autoload the next tape when the tape drive is told to eject..

>Fix:
	I'm working on one but it may be a while, so i'm filing a pr
	so this doesn't get lost.

	Probably the best bet is to call st_unmount to clear the media
	removal bit (and do a bunch of other cleanup) if the device is
	at beginning-of-tape in a close on a no-rewind device.
>Audit-Trail:
>Unformatted: