]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.fixes/libiscsi-don-t-let-io-sit-in-queue-when-session-has-failed
Imported linux-2.6.27.39 suse/xen patches.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / libiscsi-don-t-let-io-sit-in-queue-when-session-has-failed
CommitLineData
2cb7cef9
BS
1From: Mike Christie <michaelc@cs.wisc.edu>
2Date: Wed, 13 May 2009 17:57:47 -0500
3X-Git: 301e0f7e4d78e956c58b66888e134dbdb44ea28e
4Subject: libiscsi: don't let io sit in queue when session has failed
5
6If the session is failed, but we have not yet fully transitioned
7to the recovery stage we were still queueuing IO. The idea is
8that for some failures we can recvover at the command level
9and still continue to execute other IO. Well, we never have
10added the recovery within a command code, so queueing up IO here
11just creates the possibility that it might time time out so
12this just has us requeue the IO the scsi layer for now.
13
14Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
15Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16Signed-off-by: Hannes Reinecke <hare@suse.de>
17
18---
19 drivers/scsi/libiscsi.c | 15 ++++++---------
20 1 file changed, 6 insertions(+), 9 deletions(-)
21
22--- a/drivers/scsi/libiscsi.c
23+++ b/drivers/scsi/libiscsi.c
24@@ -1242,13 +1242,7 @@ int iscsi_queuecommand(struct scsi_cmnd
25 goto fault;
26 }
27
28- /*
29- * ISCSI_STATE_FAILED is a temp. state. The recovery
30- * code will decide what is best to do with command queued
31- * during this time
32- */
33- if (session->state != ISCSI_STATE_LOGGED_IN &&
34- session->state != ISCSI_STATE_FAILED) {
35+ if (session->state != ISCSI_STATE_LOGGED_IN) {
36 /*
37 * to handle the race between when we set the recovery state
38 * and block the session we requeue here (commands could
39@@ -1256,12 +1250,15 @@ int iscsi_queuecommand(struct scsi_cmnd
40 * up because the block code is not locked)
41 */
42 switch (session->state) {
43+ case ISCSI_STATE_FAILED:
44 case ISCSI_STATE_IN_RECOVERY:
45 reason = FAILURE_SESSION_IN_RECOVERY;
46- goto reject;
47+ sc->result = DID_IMM_RETRY << 16;
48+ break;
49 case ISCSI_STATE_LOGGING_OUT:
50 reason = FAILURE_SESSION_LOGGING_OUT;
51- goto reject;
52+ sc->result = DID_IMM_RETRY << 16;
53+ break;
54 case ISCSI_STATE_RECOVERY_FAILED:
55 reason = FAILURE_SESSION_RECOVERY_TIMEOUT;
56 sc->result = DID_TRANSPORT_FAILFAST << 16;