From nobody@FreeBSD.org  Wed Apr 21 01:55:57 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3E26516A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 21 Apr 2004 01:55:57 -0700 (PDT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 2F56243D77
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 21 Apr 2004 01:55:56 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.10/8.12.10) with ESMTP id i3L8tt72011204
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 21 Apr 2004 01:55:55 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.10/8.12.10/Submit) id i3L8tt9f011203;
	Wed, 21 Apr 2004 01:55:55 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200404210855.i3L8tt9f011203@www.freebsd.org>
Date: Wed, 21 Apr 2004 01:55:55 -0700 (PDT)
From: Andrew Grillet <andrew@grillet.co.uk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: poor handling of write protected floppy.
X-Send-Pr-Version: www-2.3

>Number:         65843
>Category:       misc
>Synopsis:       poor handling of write protected floppy.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 21 02:00:41 PDT 2004
>Closed-Date:    Mon Aug 23 11:05:52 GMT 2004
>Last-Modified:  Mon Aug 23 11:05:52 GMT 2004
>Originator:     Andrew Grillet
>Release:        4.9 Stable
>Organization:
Quickstart Technology Ltd
>Environment:
FreeBSD dayton.grillet.home 4.9-STABLE FreeBSD                   4.9-STABLE #3: Sun Mar 28 21:09:07 BST 2004                       root@dayton.grillet.home:/usr/src/sys/compile/DAYTON  i386     
>Description:
Handling of write protected floppy disks is totally naff! You get no message when you mount (write protected the floppy.  If you attempt to write to it (cp file /floppy) you get "io error" - suggesting a defective medium, and not "Illegal attempt to write to protected medium" or "flip the write protect tab, you nitwit". The, if you attempt to unmount the floppy to fix the problem, you are unable to do so, because the floppy is write-protected
>How-To-Repeat:
1) Instert write protected (but known good) floppy      
2) mount /floppy
3) cp file /floppy <confusing error here>
4) umount /floppy <inappropriate error here>
5) have attack of "floppy rage"
>Fix:
1) only allow ro mount if disk is write protected, otherwise refuse to mount.
2) detect the error code for "attempted write while write protected" and handle with more user friendly message      

>Release-Note:
>Audit-Trail:

From: Gregory Bond <gnb@itga.com.au>
To: Andrew Grillet <andrew@grillet.co.uk>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: misc/65843: poor handling of write protected floppy. 
Date: Thu, 22 Apr 2004 09:38:37 +1000

 This is a limitation of the hardware.  There is no way to discover that a
 floppy is write-protected until you try to write to it.  And no way to notice
 that a floppy has been inserted/removed. 
 
 Recovering from failed disk writes is also known to be unpleasant, but is very 
 hard to fix due to the kernel layering.  It's been talked about for years but 
 no-one has come up with a good solution or the time/inclination/money to do 
 the work.
 
 Short answer: Don't do that.
 
 
State-Changed-From-To: open->closed 
State-Changed-By: arved 
State-Changed-When: Mon Aug 23 11:03:04 GMT 2004 
State-Changed-Why:  
This should be fixed with the new floppy driver in CURRENT. 

Additional this PR is similar to kern/66960 which claims to  
contain a patch against STABLE. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=65843 
>Unformatted:
