From andre.albsmeier@mchp.siemens.de Sat Mar 27 23:34:17 1999
Return-Path: <andre.albsmeier@mchp.siemens.de>
Received: from david.siemens.de (david.siemens.de [192.35.17.14])
	by hub.freebsd.org (Postfix) with ESMTP id 2D6CC14A09
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 27 Mar 1999 23:34:15 -0800 (PST)
	(envelope-from andre.albsmeier@mchp.siemens.de)
Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.14])
	by david.siemens.de (8.9.3/8.9.3) with ESMTP id JAA06661
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 28 Mar 1999 09:34:12 +0200 (MET DST)
Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [146.180.31.23])
	by mail2.siemens.de (8.9.3/8.9.3) with ESMTP id JAA05219
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 28 Mar 1999 09:33:54 +0200 (MET DST)
Received: (from daemon@localhost)
	by curry.mchp.siemens.de (8.8.8/8.8.8) id JAA76414
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 28 Mar 1999 09:33:56 +0200 (CEST)
Message-Id: <199903280733.JAA73569@internal>
Date: Sun, 28 Mar 1999 09:33:53 +0200 (CEST)
From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To: FreeBSD-gnats-submit@freebsd.org
Subject: 3.1-STABLE freezes when writing to floppydrive without medium
X-Send-Pr-Version: 3.2

>Number:         10828
>Category:       kern
>Synopsis:       3.1-STABLE freezes when writing to floppydrive without medium
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 27 23:40:01 PST 1999
>Closed-Date:    Tue Jun 26 06:38:57 PDT 2001
>Last-Modified:  Tue Jun 26 23:30:01 PDT 2001
>Originator:     Andre Albsmeier
>Release:        FreeBSD 3.1-STABLE i386
>Organization:
>Environment:

FreeBSD 3.1-STABLE

>Description:

FreeBSD 3.1-STABLE freezes when you are writing to a floppy disk
drive when there is no floppy inserted. I have heard that it also
makes problems when an inserted disk is write protected.

>How-To-Repeat:

1. remove the floppy
2. dd if=/dev/zero of=/dev/fd0 bs=64k

>Fix:
	
With the help of Mike Smith I think I tracked it down a little bit.
(Was my first experience with DDB). This is part of the output of
the trace command in DDB:

... 
---- interrupt stuff ------------ 
reassignbuf
bdirty
brelse
biodone 
fdstrategy
spec_strategy
spec_vnoperate
ufs_vnoperatespec
bwrite
vop_stdbwrite
vop_defaultop

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->joerg 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Mon Mar 29 14:25:48 PST 1999 
Responsible-Changed-Why:  
He offered to look into this in kern/503 :-) 

From: Sheldon Hearn <sheldonh@iafrica.com>
To: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: kern/10828: 3.1-STABLE freezes when writing to floppydrive without medium
Date: Tue, 30 Mar 1999 00:23:01 +0200

 Same goes for CURRENT.
 
 In fact, just about any floppy failure is going to cause you trouble.
 With a bad disk, your How-To-Repeat causes:
 
 panic: vinvalbug: dirty bufs
 
 Followed by an automatic reboot when the sync fails. I'd say a 64k block
 size with _no_ count is asking for trouble, though.
 
 Ciao,
 Sheldon.
 

From: Sheldon Hearn <sheldonh@iafrica.com>
To: Cc: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>,
	freebsd-gnats-submit@freebsd.org
Subject: Re: kern/10828: 3.1-STABLE freezes when writing to floppydrive without medium 
Date: Tue, 30 Mar 1999 01:03:58 +0200

 On Tue, 30 Mar 1999 00:23:01 +0200, Sheldon Hearn wrote:
 
 > Followed by an automatic reboot when the sync fails. I'd say a 64k block
 > size with _no_ count is asking for trouble, though.
 
 In fact, looking through the PR database it seems that both you and I
 have learned something. You should _never_ use the block device for raw
 file data.
 
 See PR kern/3156 .
 
 By the way, if I _don't_ specify a block size, my machine doesn't lock
 up, even with a bad disk.
 
 Ciao,
 Sheldon.
 

From: Sheldon Hearn <sheldonh@iafrica.com>
To: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: kern/10828: 3.1-STABLE freezes when writing to floppydrive without medium 
Date: Tue, 30 Mar 1999 01:06:48 +0200

 The question that remains (and the reason the PR is left open for now)
 is whether it's reasonable to assume that anyone with access to /dev/fd0
 is allowed to lock up the machine? :-)
 
 Ciao,
 Sheldon.
 

From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To: Sheldon Hearn <sheldonh@iafrica.com>
Cc: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>,
	freebsd-gnats-submit@freebsd.org
Subject: Re: kern/10828: 3.1-STABLE freezes when writing to floppydrive without medium
Date: Tue, 30 Mar 1999 06:41:31 +0200

 On Tue, 30-Mar-1999 at 01:03:58 +0200, Sheldon Hearn wrote:
 > 
 > 
 > On Tue, 30 Mar 1999 00:23:01 +0200, Sheldon Hearn wrote:
 > 
 > > Followed by an automatic reboot when the sync fails. I'd say a 64k block
 > > size with _no_ count is asking for trouble, though.
 > 
 > In fact, looking through the PR database it seems that both you and I
 > have learned something. You should _never_ use the block device for raw
 > file data.
 > 
 > See PR kern/3156 .
 > 
 > By the way, if I _don't_ specify a block size, my machine doesn't lock
 > up, even with a bad disk.
 
 Hmm, I also had lock ups even when mounting the floppy with -t msdos
 or with mtools. Not as reproducable as the dd but sometimes. I think,
 it should not lock up with dd. If dd onto a block device is not
 allowed, there should be an error message or anything but not locking up.
 
 	-Andre
 
Responsible-Changed-From-To: joerg->freebsd-bugs 
Responsible-Changed-By: joerg 
Responsible-Changed-When: Tue Mar 30 10:42:43 MEST 1999 
Responsible-Changed-Why:  
That's rather a bug in the upper layers of the kernel than in the floppy 
driver itself; alas i'm not competent enought to fix that. 
State-Changed-From-To: open->feedback 
State-Changed-By: will 
State-Changed-When: Thu May 24 18:47:16 PDT 2001 
State-Changed-Why:  
Is this still a problem? 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=10828 

From: Mike Bristow <mike@urgle.com>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: kern/10828: 3.1-STABLE freezes when writing to floppydrive without medium
Date: Tue, 26 Jun 2001 12:46:24 +0100

 FYI:
 
 this problem still exists on FreeBSD 3.5-STABLE i386
 But doesn't on FreeBSD 4.3-STABLE-20010609T134616 i386
 
 I therefore think that "This PR can be closed" (to use phk's grep
 fodder); assuming that my understanding of the sort of bug fixes that
 should go into 3.x is correct.
 
 -- 
 Mike Bristow
State-Changed-From-To: feedback->closed 
State-Changed-By: dwmalone 
State-Changed-When: Tue Jun 26 06:38:57 PDT 2001 
State-Changed-Why:  
As pointed out by Mike Bristow, it doesn't seem to be possible to 
reproduce this on 4.X (I tried writing with no floppy, a write 
protected floppy and ejecting a writable floppy while writing and 
all seemed to produce sensible results). 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=10828 

From: Bruce Evans <bde@zeta.org.au>
To: Mike Bristow <mike@urgle.com>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/10828: 3.1-STABLE freezes when writing to floppydrive
 without medium
Date: Wed, 27 Jun 2001 16:22:42 +1000 (EST)

 On Tue, 26 Jun 2001, Mike Bristow wrote:
 
 >  this problem still exists on FreeBSD 3.5-STABLE i386
 >  But doesn't on FreeBSD 4.3-STABLE-20010609T134616 i386
 
 Variants of this problem exist in all versions of FreeBSD.  E.g., in
 RELENG_4:
 
 > On Fri, 25-May-2001 at 23:00:55 +1000, Bruce Evans wrote:
 > > On Fri, 25 May 2001, Andre Albsmeier wrote:
 > > 
 > > > On Thu, 24-May-2001 at 18:47:24 -0700, will@FreeBSD.org wrote:
 > > > > Synopsis: 3.1-STABLE freezes when writing to floppydrive without medium
 > > > > 
 > > > > State-Changed-From-To: open->feedback
 > > > > State-Changed-By: will
 > > > > State-Changed-When: Thu May 24 18:47:16 PDT 2001
 > > > > State-Changed-Why: 
 > > > > Is this still a problem?
 > > > 
 > > > The 'write without a medium error' seems to be fixed. However,
 > > > the following procedure freezes the machine when done with
 > > > a write protected floppy:
 > > > 
 > > > mount -t msdos /dev/fd0 /mnt
 > > > cp /etc/printcap /mnt
 > > > cd /mnt
 > > > ls -l
 > > 
 > > Is this in 4.3?  I would have thought that there would be no problems
 > > (except lots of retries) until unmount.
 > 
 > Yes, tested a few hours ago on FreeBSD 4.3-STABLE #61: Fri May 25 07:00:56 CEST 2001
 
 ffs in RELENG_4 is missing a fix for part of a variant of this problem
 (rev.1.150 of ffs_vfsops.c).  Most filesystems are missing this fix
 even in -current.
 
 Bruce
 
>Unformatted:
