Commit f4b31db9 authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik

libata: fix internal command failure handling

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: default avatarTejun Heo <tj@kernel.org>
Cc: stable@kernel.org
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 4f7c2874
...@@ -5028,13 +5028,15 @@ void ata_qc_complete(struct ata_queued_cmd *qc) ...@@ -5028,13 +5028,15 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
qc->flags |= ATA_QCFLAG_FAILED; qc->flags |= ATA_QCFLAG_FAILED;
if (unlikely(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 */ /* always fill result TF for failed qc */
fill_result_tf(qc); fill_result_tf(qc);
if (!ata_tag_internal(qc->tag))
ata_qc_schedule_eh(qc); ata_qc_schedule_eh(qc);
else
__ata_qc_complete(qc);
return; return;
} }
}
WARN_ON_ONCE(ap->pflags & ATA_PFLAG_FROZEN); WARN_ON_ONCE(ap->pflags & ATA_PFLAG_FROZEN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment