diff options
| author | Erik Andersen <andersen@codepoet.org> | 2003-08-22 04:29:33 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-08-22 04:29:33 -0700 |
| commit | 6c944c977f70a93d54fc6dded0f3f18f207ed1ef (patch) | |
| tree | fd2a25b15a550cd9ce8cd1d39e32264f02a41a58 /drivers | |
| parent | d2855c5dacd8dc87d6120b53e6de82c43745934a (diff) | |
[PATCH] Fix cdrom error handling in 2.6
In both 2.4 and in 2.6, error handling for bad cdrom media is
wrong. And it is my fault I'm afraid, since I botched an earlier
fix for the problem by putting the fix in the wrong spot.
My kids have a "Jumpstart Toddlers" cd they have long since
completely killed, which makes a great test disc. Without this
fix, the best time projection I can get for completing a dd type
sector copy is about 2 years... Most of that is spent thrashing
about in kernel space trying to re-read sectors we already know
are not correctable.... After the fix, I was able to rip a copy
the CD (or rather muddle through it getting lots of EIO errors)
in about 15 minutes.
Attached is the fix for 2.6.x,
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/ide/ide-cd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 4e7a197f6611..578476e1e931 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -794,16 +794,16 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) request or data protect error.*/ ide_dump_status (drive, "command error", stat); do_end_request = 1; - } else if ((err & ~ABRT_ERR) != 0) { - /* Go to the default handler - for other errors. */ - DRIVER(drive)->error(drive, "cdrom_decode_status",stat); - return 1; } else if (sense_key == MEDIUM_ERROR) { /* No point in re-trying a zillion times on a bad * sector... If we got here the error is not correctable */ ide_dump_status (drive, "media error (bad sector)", stat); do_end_request = 1; + } else if ((err & ~ABRT_ERR) != 0) { + /* Go to the default handler + for other errors. */ + DRIVER(drive)->error(drive, "cdrom_decode_status",stat); + return 1; } else if ((++rq->errors > ERROR_MAX)) { /* We've racked up too many retries. Abort. */ do_end_request = 1; |
