linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH #upstream-fixes] libata: fix internal command failure handling
@ 2009-10-16  4:00 Tejun Heo
  2009-10-16 10:27 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2009-10-16  4:00 UTC (permalink / raw)
  To: Jeff Garzik, Ethan, IDE/ATA development list

When an internal command fails, it should be failed directly without
invoking EH.  In the original implemetation, this was accomplished by
letting internal command bypass failure handling in ata_qc_complete().
However, later changes added post-successful-completion handling to
that code path and the success path is no longer adequate as internal
command failure path.  One of the visible problems is that internal
command failure due to timeout or other freeze conditions would
spuriously trigger WARN_ON_ONCE() in the success path.

This patch updates failure path such that internal command failure
handling is contained there.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@kernel.org
---
 drivers/ata/libata-core.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index b525a09..d7f0f1b 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5028,12 +5028,14 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
 			qc->flags |= ATA_QCFLAG_FAILED;

 		if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) {
-			if (!ata_tag_internal(qc->tag)) {
-				/* always fill result TF for failed qc */
-				fill_result_tf(qc);
+			/* always fill result TF for failed qc */
+			fill_result_tf(qc);
+
+			if (!ata_tag_internal(qc->tag))
 				ata_qc_schedule_eh(qc);
-				return;
-			}
+			else
+				__ata_qc_complete(qc);
+			return;
 		}

 		WARN_ON_ONCE(ap->pflags & ATA_PFLAG_FROZEN);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH #upstream-fixes] libata: fix internal command failure handling
  2009-10-16  4:00 [PATCH #upstream-fixes] libata: fix internal command failure handling Tejun Heo
@ 2009-10-16 10:27 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2009-10-16 10:27 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Ethan, IDE/ATA development list

On 10/16/2009 12:00 AM, Tejun Heo wrote:
> When an internal command fails, it should be failed directly without
> invoking EH.  In the original implemetation, this was accomplished by
> letting internal command bypass failure handling in ata_qc_complete().
> However, later changes added post-successful-completion handling to
> that code path and the success path is no longer adequate as internal
> command failure path.  One of the visible problems is that internal
> command failure due to timeout or other freeze conditions would
> spuriously trigger WARN_ON_ONCE() in the success path.
>
> This patch updates failure path such that internal command failure
> handling is contained there.
>
> Signed-off-by: Tejun Heo<tj@kernel.org>
> Cc: stable@kernel.org
> ---
>   drivers/ata/libata-core.c |   12 +++++++-----
>   1 file changed, 7 insertions(+), 5 deletions(-)

applied -- thanks for fixing!!



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-16 10:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-16  4:00 [PATCH #upstream-fixes] libata: fix internal command failure handling Tejun Heo
2009-10-16 10:27 ` Jeff Garzik

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