[PATCH] Re: IDE error on 2.4.17

Erik Andersen (andersen@codepoet.org)
Wed, 27 Feb 2002 03:25:44 -0700


On Wed Feb 27, 2002 at 10:47:35AM +0100, Vojtech Pavlik wrote:
> That won't help, this indeed is a media error. The drive is heading to
> hell. You have about another six months of life before it goes belly up
> completely.
>
> Any chance it's one of those fast IBM 30 or 45 gig drives? They seem to
> be dying pretty fast ...

I expect a patch like this would help avoid these sort of
questions...

diff -urN linux/drivers/ide.orig/hd.c linux/drivers/ide/hd.c
--- linux/drivers/ide.orig/hd.c Mon Oct 15 14:27:42 2001
+++ linux/drivers/ide/hd.c Wed Feb 27 03:16:16 2002
@@ -201,6 +201,12 @@
printk(", sector=%ld", CURRENT->sector);
}
printk("\n");
+ /* Make sure people realize that very bad things are
+ * happening, so they can do something about it before
+ * it is too late... */
+ if (hd_error & ECC_ERR) {
+ printk("hd%c: You should make a backup, this drive may fail soon!\n", devc);
+ }
}
#else
printk("hd%c: %s: status=0x%02x.\n", devc, msg, stat & 0xff);
@@ -209,6 +215,9 @@
} else {
hd_error = inb(HD_ERROR);
printk("hd%c: %s: error=0x%02x.\n", devc, msg, hd_error & 0xff);
+ if (hd_error & ECC_ERR) {
+ printk("hd%c: You should make a backup, this drive may fail soon!\n", devc);
+ }
}
#endif /* verbose errors */
restore_flags (flags);
diff -urN linux/drivers/ide.orig/ide.c linux/drivers/ide/ide.c
--- linux/drivers/ide.orig/ide.c Fri Feb 22 16:20:13 2002
+++ linux/drivers/ide/ide.c Wed Feb 27 03:20:12 2002
@@ -832,6 +832,13 @@
if (HWGROUP(drive) && HWGROUP(drive)->rq)
printk(", sector=%ld", HWGROUP(drive)->rq->sector);
}
+ if (hd_error & ECC_ERR) {
+ printk("\nhd%c: You should make a backup, this drive may fail soon!", devc);
+ }
+ }
+#else
+ if (drive->media == ide_disk && hd_error & ECC_ERR) {
+ printk("\nhd%c: You should make a backup, this drive may fail soon!", devc);
}
#endif /* FANCY_STATUS_DUMPS */
printk("\n");
-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/