lkml.org 
[lkml]   [1996]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectFloppy driver concerns
Date
Hi Alain,

Here is what may be considered a minor bug in the floppy driver:

1) Mount a floppy disk (ext2 in r/w mode)
2) sync and then pop it out once the light goes out.
3) Pop in another random (DOS even) floppy that you have laying around.
4) Now unmount the floppy.

In step 4 above, the driver happily writes the "I have been unmounted
cleanly" ext2 message to the foreign floppy, potentially scribbling
over whatever happened to be there before, and the driver doesn't even
moan one bit. Ugh. I am no floppy guru, but shouldn't the DCL be
checked before writing blindly to a removable media device, just to make
sure the user hasn't swapped in a new disk without thinking?

If you change the above situation to one that uses reads, things are
done in a sane fashion via DCL, and the driver moans loudly with a:

floppy0: disk absent or changed during operation

and then returns an IO error, which seems sensible enough.
My other minor query is why doesn't the floppy driver support:

fd = open("/dev/fd0", O_RDONLY);
ioctl(fd, BLKFLSBUF, NULL);

The other common block devices (such as SCSI disk, IDE disk and even RAM
disk) support BLKFLSBUF via invalidate_buffers().

BTW, you aren't presently listed in the MAINTAINERS file although you
are listed in the CREDITS file as the floppy driver hacker.

Regards,
Paul.


\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.110 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site