lkml.org 
[lkml]   [2003]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectSome read-errors on floppys not reported on 2.4.22
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.


-
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/

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