Subject: fd hard errors
To: None <tech-kern@netbsd.org>
From: Julio Merino <jmmv@menta.net>
List: tech-kern
Date: 12/01/2002 23:56:25
Hello

I've been looking at the fd.c driver to find a "solution" (if applicable)
for the following problem. Just try to run the following command with a
write protected floppy disk in your floppy drive:
    tar cf /dev/fd0a /bin    (or any other directory which is big enough)
You will see how the kernel becomes crazy printing out lots of messages
about "hard errors".

As far as I've deduced from fd.c, the strategy routine divides the data
beeing sent to the drive into several blocks and feeds them to the
device, freeing the requesting command.

Well, so returning to the write protected case (if there is no media in
the drive you will see similar problems), a block fails, so fdcretry
is called up to four times. At the fourth time, a hard error is issued
and that block is removed from the queue. But all other pending blocks
are tried to be written to disk. And until all those blocks are not
consumed, the kernel keeps printing messages (and the drive doing too
much noise).

As I see it, a solution could be: "If a block fails with a hard error,
remove all other pending blocks for the same drive from the queue
because they will fail, almost always". Though, I still have to learn
many things on how to implement this...

What do you think? Any better "solution"?

Thanks!

-- 
Julio Merino (http://jmmv.dyndns.org/) <jmmv@menta.net>