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 <sa...@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

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to