While working on ide-cd, I think the bad sector handling needs
serious attention... For example, I have a CD-ROM (a toddler
game for windoz) that my 2 year old son scratched into
non-functional oblivion. I attempted to extract the contents in
the hope of burning it to a new CD. Using dd conv=noerror, it
began ripping the content just fine -- till it hit the bad spot.
Then it took like 12 hours to progress by an additional 10 MB...
Looking at the ide-cd code (since I used to maintain it years
ago) it seems that on a bad sector, ide-cd retries ERROR_MAX (8)
times. But the low level ide driver is _also_ doing ERROR_MAX
retries for each of those 8 retries from ide-cd.... Do we
really need to retry 64 times when the drive told us clearly the
_first_ time that it is an uncorrectable medium error?
Perhaps something like this patch would make more sense? With
this patch is place, error handling is still awful, but at least
a dd was able to make a bit of progress....
--- linux/drivers/ide/ide-cd.c.orig Tue Apr 16 06:59:56 2002
+++ linux/drivers/ide/ide-cd.c Tue Apr 16 07:04:59 2002
@@ -657,6 +657,11 @@
request or data protect error.*/
ide_dump_status (drive, "command error", stat);
cdrom_end_request (0, drive);
+ } 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);
+ cdrom_end_request (0, drive);
} else if ((err & ~ABRT_ERR) != 0) {
/* Go to the default handler
for other errors. */
-Erik
-- Erik B. Andersen http://codepoet-consulting.com/ --This message was written using 73% post-consumer electrons-- - 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/