mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Some read-errors on floppys not reported on 2.4.22
@ 2003-08-29 16:13 Richard B. Johnson
  2003-09-04 17:17 ` Pavel Machek
  0 siblings, 1 reply; 4+ messages in thread
From: Richard B. Johnson @ 2003-08-29 16:13 UTC (permalink / raw)
  To: Linux kernel

Given the following program:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
int main()
{
    int fd;
    char buf[0x1000];
    if((fd = open("/dev/fd0", O_RDONLY)) < 0)
    {
        perror("open");
        exit(EXIT_FAILURE);
    }
    while(read(fd, buf, sizeof(buf)) > 0)
        ;
    perror("read");
    close(fd);
    return 0;
}

This program will return:

Script started on Fri Aug 29 12:05:32 2003
# ./xxx
read: Success
# exit
exit

Script done on Fri Aug 29 12:05:51 2003

Success, even where there are lots of CRC errors that
prematurely terminate the read:

end_request: I/O error, dev 02:00 (floppy), sector 101
floppy0: data CRC error: track 2, head 1, sector 12, size 2
floppy0: data CRC error: track 2, head 1, sector 12, size 2
end_request: I/O error, dev 02:00 (floppy), sector 101
floppy0: data CRC error: track 3, head 1, sector 3, size 2
floppy0: data CRC error: track 3, head 1, sector 3, size 2
end_request: I/O error, dev 02:00 (floppy), sector 128
floppy0: data CRC error: track 2, head 1, sector 12, size 2
floppy0: data CRC error: track 2, head 1, sector 12, size 2
end_request: I/O error, dev 02:00 (floppy), sector 101


This is NotGood(tm); A program may think it got all the
data, from a floppy when, in fact it wasn't able to read
more than a few sectors.


Cheers,
Dick Johnson
Penguin : Linux version 2.4.22 on an i686 machine (794.73 BogoMips).
            Note 96.31% of all statistics are fiction.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-09-08 18:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-29 16:13 Some read-errors on floppys not reported on 2.4.22 Richard B. Johnson
2003-09-04 17:17 ` Pavel Machek
2003-09-08 17:48   ` Richard B. Johnson
2003-09-08 18:48   ` Richard B. Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®