conn->ctask = list_entry(conn->xmitqueue.next,
struct iscsi_cmd_task, running);
if (conn->session->state == ISCSI_STATE_LOGGING_OUT) {
- fail_command(conn, conn->ctask, DID_NO_CONNECT << 16);
+ fail_command(conn, conn->ctask, DID_IMM_RETRY << 16);
continue;
}
if (iscsi_prep_scsi_cmd_pdu(conn->ctask)) {
* be entering our queuecommand while a block is starting
* up because the block code is not locked)
*/
- if (session->state == ISCSI_STATE_IN_RECOVERY) {
+ switch (session->state) {
+ case ISCSI_STATE_IN_RECOVERY:
reason = FAILURE_SESSION_IN_RECOVERY;
goto reject;
- }
-
- switch (session->state) {
+ case ISCSI_STATE_LOGGING_OUT:
+ reason = FAILURE_SESSION_LOGGING_OUT;
+ goto reject;
case ISCSI_STATE_RECOVERY_FAILED:
reason = FAILURE_SESSION_RECOVERY_TIMEOUT;
break;
case ISCSI_STATE_TERMINATE:
reason = FAILURE_SESSION_TERMINATE;
break;
- case ISCSI_STATE_LOGGING_OUT:
- reason = FAILURE_SESSION_LOGGING_OUT;
- break;
default:
reason = FAILURE_SESSION_FREED;
}