From: "Richard B. Johnson" <root@chaos.analogic.com>
To: Linux kernel <linux-kernel@vger.kernel.org>
Subject: Some read-errors on floppys not reported on 2.4.22
Date: Fri, 29 Aug 2003 12:13:56 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.53.0308291207430.25423@chaos> (raw)
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.
next reply other threads:[~2003-08-29 16:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-29 16:13 Richard B. Johnson [this message]
2003-09-04 17:17 ` Pavel Machek
2003-09-08 17:48 ` Richard B. Johnson
2003-09-08 18:48 ` Richard B. Johnson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.53.0308291207430.25423@chaos \
--to=root@chaos.analogic.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®