* 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
* Re: Some read-errors on floppys not reported on 2.4.22
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
0 siblings, 2 replies; 4+ messages in thread
From: Pavel Machek @ 2003-09-04 17:17 UTC (permalink / raw)
To: Richard B. Johnson; +Cc: Linux kernel
Hi!
> Success, even where there are lots of CRC errors that
> prematurely terminate the read:
Can you find out if it works in 2.4.21?
--
Pavel
Written on sharp zaurus, because my Velo1 broke. If you have Velo you don't need...
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Some read-errors on floppys not reported on 2.4.22
2003-09-04 17:17 ` Pavel Machek
@ 2003-09-08 17:48 ` Richard B. Johnson
2003-09-08 18:48 ` Richard B. Johnson
1 sibling, 0 replies; 4+ messages in thread
From: Richard B. Johnson @ 2003-09-08 17:48 UTC (permalink / raw)
To: Pavel Machek; +Cc: Linux kernel
On Thu, 4 Sep 2003, Pavel Machek wrote:
> Hi!
>
> > Success, even where there are lots of CRC errors that
> > prematurely terminate the read:
>
> Can you find out if it works in 2.4.21?
> --
> Pavel
> Written on sharp zaurus, because my Velo1 broke. If you have Velo you don't need...
>
I will try and get back to you. I was not able to even boot
2.4.21 on my system because there were problems with aic7xxx
SCSI disk controller so I gave up. I will mix/match and see
what I can find.
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
* Re: Some read-errors on floppys not reported on 2.4.22
2003-09-04 17:17 ` Pavel Machek
2003-09-08 17:48 ` Richard B. Johnson
@ 2003-09-08 18:48 ` Richard B. Johnson
1 sibling, 0 replies; 4+ messages in thread
From: Richard B. Johnson @ 2003-09-08 18:48 UTC (permalink / raw)
To: Pavel Machek; +Cc: Linux kernel
On Thu, 4 Sep 2003, Pavel Machek wrote:
> Hi!
>
> > Success, even where there are lots of CRC errors that
> > prematurely terminate the read:
>
> Can you find out if it works in 2.4.21?
> --
> Pavel
Okay. It works on 2.4.21, the code is identical to 2.4.20 which also
works. On 2.4.22, bad CRC errors which terminate the read, don't
always result in a bad return code. Some just return 0, which
is treated like EOF in user-mode code. Application software
has to add a call to fstat() to see if the bytes read were equal
to the file size as a work-around. This step should not be required.
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;
as well as URLs for NNTP newsgroup(s).