linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] libata: fix ata_qc_issue failure path
@ 2006-03-31 11:36 Tejun Heo
  2006-03-31 11:41 ` [PATCH 2/2] libata: make ata_qc_issue complete failed qcs Tejun Heo
  2006-03-31 15:16 ` [PATCH 1/2] libata: fix ata_qc_issue failure path Jeff Garzik
  0 siblings, 2 replies; 4+ messages in thread
From: Tejun Heo @ 2006-03-31 11:36 UTC (permalink / raw)
  To: Jeff Garzik, linux-ide

On sg_err failure path, ata_qc_issue() doesn't mark the qc active
before returning.  This triggers WARN_ON() in __ata_qc_complete() when
the qc gets completed.  This patch moves ap->active_tag and
QCFLAG_ACTIVE setting to the top of the function.

Signed-off-by: Tejun Heo <htejun@gmail.com>

Index: work/drivers/scsi/libata-core.c
===================================================================
--- work.orig/drivers/scsi/libata-core.c	2006-03-31 20:28:47.000000000 +0900
+++ work/drivers/scsi/libata-core.c	2006-03-31 20:34:02.000000000 +0900
@@ -4006,6 +4006,9 @@ unsigned int ata_qc_issue(struct ata_que
 {
 	struct ata_port *ap = qc->ap;
 
+	qc->ap->active_tag = qc->tag;
+	qc->flags |= ATA_QCFLAG_ACTIVE;
+
 	if (ata_should_dma_map(qc)) {
 		if (qc->flags & ATA_QCFLAG_SG) {
 			if (ata_sg_setup(qc))
@@ -4020,9 +4023,6 @@ unsigned int ata_qc_issue(struct ata_que
 
 	ap->ops->qc_prep(qc);
 
-	qc->ap->active_tag = qc->tag;
-	qc->flags |= ATA_QCFLAG_ACTIVE;
-
 	return ap->ops->qc_issue(qc);
 
 sg_err:

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

end of thread, other threads:[~2006-03-31 18:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-31 11:36 [PATCH 1/2] libata: fix ata_qc_issue failure path Tejun Heo
2006-03-31 11:41 ` [PATCH 2/2] libata: make ata_qc_issue complete failed qcs Tejun Heo
2006-03-31 15:16 ` [PATCH 1/2] libata: fix ata_qc_issue failure path Jeff Garzik
2006-03-31 18:41   ` Tejun Heo

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