2.5.13 floppy driver is broken

From: Mikael Pettersson (mikpe@csd.uu.se)
Date: Sun May 05 2002 - 18:28:36 EST


There are at least two major problems with drivers/block/floppy.c
in 2.5.13:

1. Writing to /dev/fd0 fails with EROFS from open().
   The driver's open() method relies on revalidate() having read the
   first block and sensed whether the floppy is writable or not.
   But this code was #if:ed out (lines 3883-3903) in 2.5.13, causing
   open() to think the floppy is write-protected and return -EROFS.
   Simply removing the #if 0 doesn't work since some of the code
   in there no longer compiles in 2.5.13.
   A workaround is to read from /dev/fd0 before writing.

2. The data written is seriously corrupted. I compared a bzImage
   written to /dev/fd0 with 2.4.19-pre8 and 2.5.13. The first 9K was Ok,
   but then 2.5.13 wrote data starting from offset 8K in the input.
   I checked if the remaining data was simply shifted 1K, but that
   was not the case: there are other differences (the next one at
   offset 18K) but I haven't fully analysed the pattern.
   I suspect there's some kind of block size confusion error.

/Mikael
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue May 07 2002 - 22:00:25 EST