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