linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Erik Andersen <andersen@codepoet.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] Fix cdrom error handling in 2.6
Date: Fri, 22 Aug 2003 19:21:42 -0600	[thread overview]
Message-ID: <20030823012142.GA6076@codepoet.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0308221732170.4677-100000@home.osdl.org>

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,

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--


--- linux-2.6.0-test3/drivers/ide/ide-cd.c.orig	2003-08-22 19:04:36.000000000 -0600
+++ linux-2.6.0-test3/drivers/ide/ide-cd.c	2003-08-22 19:04:49.000000000 -0600
@@ -794,16 +794,16 @@
 			   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;

  reply	other threads:[~2003-08-23  1:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-23  0:48 Linux 2.6.0-test4 Linus Torvalds
2003-08-23  1:21 ` Erik Andersen [this message]
2003-08-23 12:26 ` vlad
2003-08-23 15:31   ` Jeff Garzik
2003-08-23 15:33     ` William Scott Lockwood III
2003-08-25  5:43     ` vlad
2003-08-24 11:39 ` [PATCH] airo (was: Re: Linux 2.6.0-test4) Geert Uytterhoeven
2003-08-24 21:00   ` Javier Achirica
2003-08-24 11:47 ` [PATCH] vmlinux-*.lds " Geert Uytterhoeven
2003-08-24 11:51 ` [PATCH] macide " Geert Uytterhoeven
2003-08-24 12:20   ` Christoph Hellwig
2003-08-24 12:29     ` Geert Uytterhoeven
2003-08-25 21:00 ` [patch] 2.6.0-test4: sis190 doesn't compile with gcc 2.95 Adrian Bunk
2003-08-26 17:44   ` Jeff Garzik
2003-08-25 21:20 ` Linux 2.6.0-test4 insecure
2003-08-25 21:26   ` [PATCH] raceless request_region() fix (was Re: Linux 2.6.0-test4) insecure
2003-08-25 21:59     ` Jeff Garzik
2003-08-26  5:20       ` insecure
2003-08-25 22:56 ` Linux 2.6.0-test4 (compile statistics) John Cherry
2003-08-30  9:04 ` Linux 2.6.0-test4 Ralf Hildebrandt

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=20030823012142.GA6076@codepoet.org \
    --to=andersen@codepoet.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    --subject='Re: [PATCH] Fix cdrom error handling in 2.6' \
    /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

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).