From nobody  Fri Dec  5 01:54:07 1997
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.7/8.8.7) id BAA08616;
          Fri, 5 Dec 1997 01:54:07 -0800 (PST)
          (envelope-from nobody)
Message-Id: <199712050954.BAA08616@hub.freebsd.org>
Date: Fri, 5 Dec 1997 01:54:07 -0800 (PST)
From: gram@cdsec.com
To: freebsd-gnats-submit@freebsd.org
Subject: Mounted MS-DOS floppy disk writes unreliable/reads can crash system
X-Send-Pr-Version: www-1.0

>Number:         5231
>Category:       kern
>Synopsis:       Mounted MS-DOS floppy disk writes unreliable/reads can crash system
>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:   Fri Dec  5 02:00:03 PST 1997
>Closed-Date:    Sat Jan 23 11:00:13 PST 1999
>Last-Modified:  Sat Jan 23 11:02:46 PST 1999
>Originator:     Graham Wheeler
>Release:        2.2.2
>Organization:
Citadel Data Security
>Environment:
FreeBSD gram.cdsec.com 2.2.2-RELEASE FreeBSD 2.2.2-RELEASE #0: Mon Sep 29 12:34:17 SAT 1997     root@gram.cdsec.com:/home/src/sys/compile/GRAM  i386

>Description:
I find that writing files to a mounted MS-DOS floppy disk almost always
results in the file being written with data errors. If I unmount the
diskette, remount it, and copy the file back, the hard-drive light 
goes on and the system freezes. This is with an Adaptec 1542B, although
I also have problems with my home PC which uses a motherboard-based FDC.
I haven't tried reading a corrupt diskette on the IDE machine as yet,
but I suspect the behaviour will be similar. I suspect that the corruption
on write is due to the PC services other interrupts while the write is
in progress; i.e. is timing related. The freeze on read is probably a
bug in the MS-DOS filesystem support.

Reading a non-corrupt floppy (written while DOS is booted) is fine.

I've long known about the write corruption; the freeze  I only noticed
yesterday when I tried to write a small file, hoping that the fact that
it was small would let me be successful for a change.


>How-To-Repeat:
Easy in my case - just do it again...
>Fix:
The only workaround I know is to copy files to my DOS HDD partition,
boot DOS, and then copy them to the floppy - which is rather tedious.

>Release-Note:
>Audit-Trail:

From: J Wunsch <j@uriah.heep.sax.de>
To: gram@cdsec.com
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/5231: Mounted MS-DOS floppy disk writes unreliable/reads can crash system
Date: Tue, 9 Dec 1997 21:43:18 +0100

 As gram@cdsec.com wrote:
 
 >  This is with an Adaptec 1542B, although
 > I also have problems with my home PC which uses a motherboard-based FDC.
 > I haven't tried reading a corrupt diskette on the IDE machine as yet,
 > but I suspect the behaviour will be similar. I suspect that the corruption
 > on write is due to the PC services other interrupts while the write is
 > in progress; i.e. is timing related.
 
 No, interrupts are interrupts, floppy transfers are done by DMA.
 
 Does it also happen when _writing_ floppies on the IDE machine?  Note
 that the FDC itself is totally unrelated, but the concurrent use of
 the AHA154x probably is.
 
 The AHA154x series has been known to hog the bus in DMA mode for too
 long for a long time.  The floppy driver silently retries all
 transfers that have been aborted by the FDC with an error flag of
 ``DMA overrun'', until the transfer finally succeeds.  When reading,
 this only reduces your effective data rate (drastically, btw.).  When
 writing however, this means you've got half-written sectors all over
 the place, which have to be retried.  This can cause subtle side-
 effects.
 
 If the above is indeed your problem, i'm afraid we can't do very much
 about it.  DOS doesn't suffer from the problem solely since SCSI and
 floppy transfers never happen by the same time.  Serializing all disk
 IO requests in Unix just for the purpose of supporting misbehaving
 hardware is probably a little much of work...
 
 I can try to reproduce and verify this on my scratch machine, although
 the floppy driver there is largely unused...  That's with an AHA1540A
 adapter, and i know it suffers from the DMA overrun syndrome.  (The
 initial ``retry all DMA overrun aborted transfers'' has been developed
 and tested on this machine.)
 
 -- 
 cheers, J"org
 
 joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
 Never trust an operating system you don't have sources for. ;-)
State-Changed-From-To: open->feedback 
State-Changed-By: phk 
State-Changed-When: Fri May 8 14:01:41 PDT 1998 
State-Changed-Why:  
Can we get a report based on a more recent freebsd version ? 
State-Changed-From-To: feedback->closed 
State-Changed-By: rnordier 
State-Changed-When: Sat Jan 23 11:00:13 PST 1999 
State-Changed-Why:  
Stale: no response to feedback request.  I this is still an issue with 
3.x/4.x, please submit a fresh PR. 
>Unformatted:
