[lkml]   [1996]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Read from CD-Rom -> crash
Thomas Niederreiter:

: there is a quite critical bug in the CD-Rom-Code which caused for me
: some extreme heavy crashes. (Reset-Button only)

: The last 4 blocks (each 2048 bytes) can't be read in most cases.
: And here on kernel pre2.0.7 this causes the total blackout.
: 1.3.98 just reports a lot of sense-errors but recovers.

Yes. The (or at least a) problem is the read-ahead.

The SCSI (and other) drivers cannot handle hardware problems -
things used to be worse, but we are still very far from
a satisfactory situation.
This means that if the kernel tries to do readahead past
the end of the CD, it may crash, or get into a "resetting for
second half of retries ..." syndrome. Unpleasantness.

You can set readahead to 0 using the small "raset" utility
below, and this at least allows one to read the last few
blocks on the CD.

What really has to be done is to keep the information that
a request is not from the user but is readahead invented by the
kernel, so that no resetting and retrying is attempted when
readahead fails. I have some patches, but I think it would be
inappropriate to make radical changes in the SCSI code just
before 2.0.


------------ raset.c ---------------------------------
* raset.c - aeb - set readahead
#include <stdio.h>
#include <linux/fs.h>

main(int argc, char **argv) {
int fd;
long ra;

if(argc != 2 && argc != 3) {
fprintf(stderr, "call: raset device [read-ahead-count]\n");

fd = open(argv[1], 0);
if (fd < 0) {
fprintf(stderr, "cannot open %s\n", argv[1]);

if (ioctl(fd, BLKRAGET, &ra)) {

printf("current read-ahead: %ld\n", ra);

if (argc == 3) {
ra = atol(argv[2]);
printf("setting it to %ld\n", ra);

if (ioctl(fd, BLKRASET, ra)) {

return 0;

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