From: Mark Lord <kernel@teksavvy.com>
To: Tejun Heo <htejun@gmail.com>
Cc: IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: [PATCH] libata-eh don't waste time retrying media errors
Date: Tue, 01 May 2012 20:00:50 -0400 [thread overview]
Message-ID: <4FA07932.2090003@teksavvy.com> (raw)
In-Reply-To: <4FA07655.6090506@teksavvy.com>
[-- Attachment #1: Type: text/plain, Size: 947 bytes --]
ATA and SATA drives have had built-in retries for media errors
for as long as they've been commonplace in computers (early 1990s).
When libata stumbles across a bad sector, it can waste minutes
sitting there doing retry after retry before finally giving up
and letting the higher layers deal with it.
This patch removes retries for media errors only.
Signed-off-by: Mark Lord <mlord@pobox.com>
--- linux-3.3.4/drivers/ata/libata-eh.c 2012-04-27 13:17:35.000000000 -0400
+++ linux/drivers/ata/libata-eh.c 2012-05-01 19:53:55.586811975 -0400
@@ -2121,8 +2121,9 @@
/* determine whether the command is worth retrying */
if (qc->flags & ATA_QCFLAG_IO ||
(!(qc->err_mask & AC_ERR_INVALID) &&
- qc->err_mask != AC_ERR_DEV))
- qc->flags |= ATA_QCFLAG_RETRY;
+ !(qc->err_mask & AC_ERR_DEV)))
+ if (!(qc->err_mask & AC_ERR_MEDIA))
+ qc->flags |= ATA_QCFLAG_RETRY;
/* accumulate error info */
ehc->i.dev = qc->dev;
[-- Attachment #2: 02_libata_sata_dont_retry_media_errors.patch --]
[-- Type: text/x-patch, Size: 662 bytes --]
Prevent libata from retrying bad sectors.
Otherwise a single bad sector gets stuck here for minutes at a time.
--- linux-3.3.4/drivers/ata/libata-eh.c 2012-04-27 13:17:35.000000000 -0400
+++ linux/drivers/ata/libata-eh.c 2012-05-01 19:53:55.586811975 -0400
@@ -2121,8 +2121,9 @@
/* determine whether the command is worth retrying */
if (qc->flags & ATA_QCFLAG_IO ||
(!(qc->err_mask & AC_ERR_INVALID) &&
- qc->err_mask != AC_ERR_DEV))
- qc->flags |= ATA_QCFLAG_RETRY;
+ !(qc->err_mask & AC_ERR_DEV)))
+ if (!(qc->err_mask & AC_ERR_MEDIA))
+ qc->flags |= ATA_QCFLAG_RETRY;
/* accumulate error info */
ehc->i.dev = qc->dev;
next prev parent reply other threads:[~2012-05-02 0:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-01 20:12 ata_eh_link_autopsy: Bug? Mark Lord
2012-05-01 20:27 ` Mark Lord
2012-05-01 21:58 ` Tejun Heo
2012-05-01 23:48 ` Mark Lord
2012-05-01 23:52 ` Mark Lord
2012-05-02 0:00 ` Mark Lord [this message]
2012-05-02 3:03 ` [PATCH] libata-eh don't waste time retrying media errors (v2) Mark Lord
2012-05-02 15:54 ` Tejun Heo
2012-05-02 19:10 ` Mark Lord
2012-05-02 19:22 ` [PATCH] libata-eh don't waste time retrying media errors (v3) Mark Lord
2012-05-02 19:33 ` Tejun Heo
2012-05-02 19:43 ` Mark Lord
2012-05-02 19:46 ` Tejun Heo
2012-05-04 2:25 ` Jeff Garzik
2012-05-04 3:04 ` Mark Lord
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=4FA07932.2090003@teksavvy.com \
--to=kernel@teksavvy.com \
--cc=htejun@gmail.com \
--cc=linux-ide@vger.kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).