Subject: Re: Empty floppy drive - that old problem
To: Richard Rauch <rkr@olib.org>
From: Stephen Borrill <netbsd@precedence.co.uk>
List: netbsd-help
Date: 10/16/2003 10:15:18
On Thu, 16 Oct 2003, Richard Rauch wrote:
> Re. http://mail-index.netbsd.org/netbsd-help/2003/10/15/0000.html
> 
> Is there an old bug-report on this?

Not that I can see.
 
> You may be the first person to encounter it.  (I've never heard of it)

I think most people are just aware of it. Or rather, generally because you
have to manually mount a floppy, you are doing so to get some data from
it. You see the problem more with amd and VMWare as that is more likely
to attempt mounting an empty floppy.

http://mail-index.netbsd.org/port-i386/2002/01/12/0015.html

> 
> However, after about 5 tries, it seems to give up reporting a "hard error".
> Until it gives up, it seems to hog the CPU, though, making other actions
> sluggish, and seems to ignore ^C attempts to break it.  I.e., it seems
> to be in the kernel, and nastily done (busy-waiting, maybe?).
 
Yes, it does give up eventually, but it's not a quick response.
 
> But, it's a new one on me.  I don't know if it was smarter in the past,
> or if I just haven't had to deal with it because I don't do floppies
> if I can avoid them.  I'm intrigued enough to have a quick rummage around
> the sources.

[from private mail]
> I don't know if this will do what you want, but in ..src/sys/dev/isa/fd.c
> there are two functions (fdcresult() and out_fdc()) that each will
> repeat their attempted commands 100000 times.
[snip]
> If you change the 100000 numbers to something smaller, that might at
> least make it more bearable for people who manually try to mount an
> empty drive.

It's certainly a good theory. With 100000 "date; ls /mnt/floppy; date"
takes 38 seconds. When set to 100, the timeouts come slightly quicker and
the commands above take 25 seconds. It's still a hell of long time to
determine whether the floppy is empty or not, but it is an improvement.

> For automounting, I assume that the problem is that the automounter is
> repeating the failed mount attempt.  (I would think that after the
> mount attempt finally fails, amd would simply give up and leave the
> filesystem unmounted...)

No, I don't think it does repeat it. It's not an amd thing as doing a
manual mount takes the same time as the automount. i.e.
date; mount_msdos /dev/fd0a /mnt; date

-- 
Stephen