NetBSD Problem Report #738

From gnats  Wed Jan 18 07:19:13 1995
Received: from bloom-beacon.MIT.EDU (brnstnd@kramden.acf.nyu.edu@BLOOM-BEACON.MIT.EDU [18.181.0.26]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id HAA15009 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Wed, 18 Jan 1995 07:19:12 -0800
Message-Id: <199501181511.KAA00840@orchard.medford.ma.us>
Date: Wed, 18 Jan 1995 10:11:03 -0500
From: sommerfeld@orchard.medford.ma.us (Bill Sommerfeld)
Reply-To: sommerfeld@orchard.medford.ma.us
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: r/w opens of r/o scsi tapes devices should fail.
X-Send-Pr-Version: 3.2

>Number:         738
>Category:       kern
>Synopsis:       r/w opens of r/o scsi tapes should fail.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 18 07:20:04 +0000 1995
>Closed-Date:    Wed Aug 12 20:11:11 +0000 1998
>Last-Modified:  Wed Aug 12 20:15:40 +0000 1998
>Originator:     Bill Sommerfeld
>Release:        1.0
>Organization:
"	"
>Environment:

System: NetBSD orchard.medford.ma.us 1.0_BETA NetBSD 1.0_BETA (ORCHARD) #13: Wed Aug 17 11:51:25 EDT 1994 sommerfeld@orchard.medford.ma.us:/u1/nsys/sys/arch/i386/compile/ORCHARD i386
	(yeah, I know, I should update to 1.0 final.  haven't found the time yet)

>Description:
	The system should be able to detect that a device with
	write-protectable media has write-protected media in it, and 
	disallow opens for write.

	Currently, the open succeeds, and subsequent writes fail,
	with a bunch of ugly kernel printfs.

	I'm filing this against "kern" rather than "port-i386" because
	I'm under the impression that the higher-level scsi subsystem is
	machine-independant.
>How-To-Repeat:
	write protect a tape and insert into drive.
	attempt to dump a partition to that device.
	observe a bunch of kernel printfs reporting write errors.
>Fix:
	?? ask scsi device w/removeable media if it's write-protected
	at open time if a r/w open is done, and fail the open if
	it's write protected.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: is 
State-Changed-When: Sun Dec 28 13:15:29 PST 1997 
State-Changed-Why:  
Is the timeout too showrt for you even in 1.3(_BETA)? 
Regards, 
-is 
Responsible-Changed-From-To: kern-bug-people->is 
Responsible-Changed-By: is 
Responsible-Changed-When: Sun Dec 28 13:17:05 PST 1997 
Responsible-Changed-Why:  
I'm looking at this 
. 
State-Changed-From-To: feedback->analyzed 
State-Changed-By: is 
State-Changed-When: Mon Dec 29 14:02:51 PST 1997 
State-Changed-Why:  
Tested myself. 
Its still as described (although dump es especially bad, becaus it uses a 
couple of slaveds all trying to writeö most other programs abort on the first 
failed write and create only one kernel printf). 


Responsible-Changed-From-To: is->kern-bug-people 
Responsible-Changed-By: is 
Responsible-Changed-When: Mon Dec 29 14:02:51 PST 1997 
Responsible-Changed-Why:  
I don't know what the desirable behaviour is. 
. 
State-Changed-From-To: analyzed->closed 
State-Changed-By: mjacob 
State-Changed-When: Wed Aug 12 13:11:11 PDT 1998 
State-Changed-Why:  
Closed as "will not fix". 

I was all set to fix this, but Jason convinced me that the recent change 
to the st driver to allow pass through SCSI commands (which require *write* 
access) through the 'normal' device means that failing an open of a normal 
device because the tape isn't writable would lose. It's a subtle but valid 
point. 

So- if you open a tape for writing and wish to find out whether it is 
writable prior to issuing the write, use the MTIOCGET ioctl and check 
the MT_DS_MOUNTED and MT_DS_RDONLY bits. 
>Unformatted:

 Obviously, I mixed up two PRs. The feedback question for this one is:
 "Do you still ovbserve this with -1.3?"
 	-is

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.