public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] libiscsi: Don't retry if xmit_task return a non-transient error code
@ 2014-08-17 15:23 Sagi Grimberg
  2014-08-27 18:44 ` Mike Christie
  0 siblings, 1 reply; 2+ messages in thread
From: Sagi Grimberg @ 2014-08-17 15:23 UTC (permalink / raw)
  To: michaelc, jbottomley, hch; +Cc: linux-scsi, ogerlitz

Allow transport callback xmit_task to return a non-transient
error code -EINVAL to inform us not to retry the task. For any
other error code keep the current retry behavior.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
---
 drivers/scsi/libiscsi.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 3d1bc67..03768a9 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1722,10 +1722,17 @@ int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc)
 				goto prepd_fault;
 			}
 		}
-		if (session->tt->xmit_task(task)) {
+
+		reason = session->tt->xmit_task(task);
+		if (reason) {
 			session->cmdsn--;
-			reason = FAILURE_SESSION_NOT_READY;
-			goto prepd_reject;
+			if (reason == -EINVAL) {
+				sc->result = DID_ABORT << 16;
+				goto prepd_fault;
+			} else {
+				reason = FAILURE_SESSION_NOT_READY;
+				goto prepd_reject;
+			}
 		}
 	} else {
 		list_add_tail(&task->running, &conn->cmdqueue);
-- 
1.7.1


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

end of thread, other threads:[~2014-08-27 18:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-17 15:23 [PATCH RESEND] libiscsi: Don't retry if xmit_task return a non-transient error code Sagi Grimberg
2014-08-27 18:44 ` Mike Christie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox