Bad Floppy buffering in Verion 2.3.36

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Wed Jan 12 2000 - 15:13:09 EST


I make an ext2 file-system on /dev/fd0, mount the file system,
add some files, install a boot-loader (LILO), then unmount the
file-system.

I wait until the floppy LED is off.

Then I `cp /dev/fd0 raw.dat`. This should be an image of everything
on the device.

However, it isn't. What LILO wrote is missing. I have to eject the
floppy, then reinsert the floppy. Then, `cp /dev/fd0 raw.dat` gives
me the correct contents of the device.

I can also execute this code-snippet to achieve the same result.

    if((fd = open(floppy, O_RDWR)) < 0)
    {
        fprintf(stderr, "Can't open %s\n", floppy);
        exit(EXIT_FAILURE);
    }
    if(ioctl(fd, FDFLUSH, NULL) < 0)
    {
        fprintf(stderr, "Bad ioctl(FDFLUSH)\n");
        exit(EXIT_FAILURE);
    }

Somebody isn't invalidating buffers when the floppy is unmounted.
In all cases, the floppy contents are correct. It's just that
'memory' contents are not, and memory contents are being used for
the next device access.

Cheers,
Dick Johnson

Penguin : Linux version 2.3.36 on an i686 machine (400.59 BogoMips).

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



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:20 EST