From e58b6d735c0c3f8e7f03a84ed315be6765347683 Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Wed, 13 May 2009 17:57:47 -0500 Subject: [PATCH] --- yaml --- r: 148059 b: refs/heads/master c: 301e0f7e4d78e956c58b66888e134dbdb44ea28e h: refs/heads/master i: 148057: 209886c3c229a1245822d2ed3fd017a340ae1a01 148055: adc7ddb27b7daba4b73c3816f3c82a1009d1035d v: v3 --- [refs] | 2 +- trunk/drivers/scsi/libiscsi.c | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 8bde96f491b6..49caeb8e1318 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3bbaaad95fd38dedb7c66a601f14825b4e0c5a59 +refs/heads/master: 301e0f7e4d78e956c58b66888e134dbdb44ea28e diff --git a/trunk/drivers/scsi/libiscsi.c b/trunk/drivers/scsi/libiscsi.c index a9d7e520e551..57eb3af40e96 100644 --- a/trunk/drivers/scsi/libiscsi.c +++ b/trunk/drivers/scsi/libiscsi.c @@ -1390,13 +1390,7 @@ int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) goto fault; } - /* - * ISCSI_STATE_FAILED is a temp. state. The recovery - * code will decide what is best to do with command queued - * during this time - */ - if (session->state != ISCSI_STATE_LOGGED_IN && - session->state != ISCSI_STATE_FAILED) { + if (session->state != ISCSI_STATE_LOGGED_IN) { /* * to handle the race between when we set the recovery state * and block the session we requeue here (commands could @@ -1404,12 +1398,15 @@ int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) * up because the block code is not locked) */ switch (session->state) { + case ISCSI_STATE_FAILED: case ISCSI_STATE_IN_RECOVERY: reason = FAILURE_SESSION_IN_RECOVERY; - goto reject; + sc->result = DID_IMM_RETRY << 16; + break; case ISCSI_STATE_LOGGING_OUT: reason = FAILURE_SESSION_LOGGING_OUT; - goto reject; + sc->result = DID_IMM_RETRY << 16; + break; case ISCSI_STATE_RECOVERY_FAILED: reason = FAILURE_SESSION_RECOVERY_TIMEOUT; sc->result = DID_TRANSPORT_FAILFAST << 16;