1 From: Hannes Reinecke <hare@suse.de>
2 Date: Tue, 18 Aug 2009 11:37:41 +0200
3 Subject: libiscsi: Update queuecommand return codes for multipathing
6 For multipathing we should be returning DID_TRANSPORT_XXX
7 messages for any error which should be retried on some other
8 path. And the 'chkready' function is quite pointless here.
10 Signed-off-by: Hannes Reinecke <hare@suse.de>
12 drivers/scsi/libiscsi.c | 9 +++------
13 1 files changed, 3 insertions(+), 6 deletions(-)
15 diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
16 index 14ba60f..32b30f1 100644
17 --- a/drivers/scsi/libiscsi.c
18 +++ b/drivers/scsi/libiscsi.c
19 @@ -1327,12 +1327,6 @@ int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
20 session = cls_session->dd_data;
21 spin_lock(&session->lock);
23 - reason = iscsi_session_chkready(cls_session);
25 - sc->result = reason;
29 if (session->state != ISCSI_STATE_LOGGED_IN) {
31 * to handle the race between when we set the recovery state
32 @@ -1342,6 +1336,9 @@ int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
34 switch (session->state) {
35 case ISCSI_STATE_FAILED:
36 + reason = FAILURE_SESSION_FAILED;
37 + sc->result = DID_TRANSPORT_DISRUPTED << 16;
39 case ISCSI_STATE_IN_RECOVERY:
40 reason = FAILURE_SESSION_IN_RECOVERY;
41 sc->result = DID_IMM_RETRY << 16;