Subject: Re: Poor behavior on I/O error...
To: Michael Lyle <mlyle@recourse.net>
From: Jaromír <jdolecek@netbsd.org>
List: tech-kern
Date: 04/22/2001 13:05:23
Michael Lyle wrote:
> Something else that I've run into a few times that I'd like to fix is 
> poor handling of fd error conditions..  For instance, if one tries to
> dd a floppy but there is no floppy in the drive, one gets a rather
> large set of errors:

Yeah, this fd(4) behaviour bothered me for quite a long time.
I'd be grateful if it would be fixed :)

IIRC, there is a BIOS call on i386 to check if there is a medium
loaded in the drive; that would be worth checking.

Jaromir
> 
> fd0a: hard error writing fsbn 984 of 984-987 (st0 40<abnrml> st1 2<write_protect> st2 0 cyl 27 head 0 sec 13)
> fd0a: hard error writing fsbn 988 of 988-991 (st0 40<abnrml> st1 2<write_protect> st2 0 cyl 27 head 0 sec 17)
> fd0a: hard error writing fsbn 992 of 992-995 (st0 44<abnrml,top_head> st1 2<write_protect> st2 0 cyl 27 head 1 sec 3)
> fd0a: hard error writing fsbn 996 of 996-999 (st0 44<abnrml,top_head> st1 2<write_protect> st2 0 cyl 27 head 1 sec 7)
> 
> and the floppy drive continues whirring as each write operation
> is attempted, and the dd process hangs for 7-8 minutes.
> 
> My idea of how to solve this is to keep a flag as to whether the disk
> is usable..  it would be set to true when the disk device is opened or
> a disk change event occurs;  and it would be set to false when a large
> number of consecutive errors occur.  if the flag is false, fdstrategy
> would discard the I/O operations.  
> 
> Comments?
> 
> Mike
> 
> -- 
> Michael P. Lyle
> 


-- 
Jaromir Dolecek <jdolecek@NetBSD.org>      http://www.ics.muni.cz/~dolecek/
NetBSD - just plain best OS! -=*=- Got spare MCA cards or docs? Hand me them!