]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.39/patches.fixes/iscsi_tcp-return-a-descriptive-error-value
Imported linux-2.6.27.39 suse/xen patches.
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / iscsi_tcp-return-a-descriptive-error-value
1 From: Mike Christie <michaelc@cs.wisc.edu>
2 Date: Wed, 24 Sep 2008 11:46:13 -0500
3 Subject: iscsi_tcp: return a descriptive error value during connection errors
4 X-Git: 6f481e3cefeb33094e87af176587e6a3027f104e
5 References: bnc#472432
6
7 The segment->done functions return a iscsi error value which gives
8 a lot more info than conn failed, so this patch has us return
9 that value. I also add a new one for xmit failures.
10
11 Adapted for SLES11 to not break kABI.
12
13 Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
14 Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 Signed-off-by: Hannes Reinecke <hare@suse.de>
16 ---
17 diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
18 index b870bfc..324e719 100644
19 --- a/drivers/scsi/iscsi_tcp.c
20 +++ b/drivers/scsi/iscsi_tcp.c
21 @@ -1010,7 +1010,7 @@ iscsi_tcp_recv(read_descriptor_t *rd_desc, struct sk_buff *skb,
22
23 error:
24 debug_tcp("Error receiving PDU, errno=%d\n", rc);
25 - iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
26 + iscsi_conn_failure(conn, rc);
27 return 0;
28 }
29
30 @@ -1150,8 +1150,10 @@ iscsi_xmit(struct iscsi_conn *conn)
31
32 while (1) {
33 rc = iscsi_tcp_xmit_segment(tcp_conn, segment);
34 - if (rc < 0)
35 + if (rc < 0) {
36 + rc = ISCSI_ERR_CONN_FAILED;
37 goto error;
38 + }
39 if (rc == 0)
40 break;
41
42 @@ -1160,7 +1162,7 @@ iscsi_xmit(struct iscsi_conn *conn)
43 if (segment->total_copied >= segment->total_size) {
44 if (segment->done != NULL) {
45 rc = segment->done(tcp_conn, segment);
46 - if (rc < 0)
47 + if (rc != 0)
48 goto error;
49 }
50 }
51 @@ -1175,8 +1177,8 @@ error:
52 /* Transmit error. We could initiate error recovery
53 * here. */
54 debug_tcp("Error sending PDU, errno=%d\n", rc);
55 - iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
56 - return rc;
57 + iscsi_conn_failure(conn, rc);
58 + return -EIO;
59 }
60
61 /**
62 --
63 1.6.0.2
64