aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/iscsi_tcp.c
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2008-09-24 12:46:13 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-10-13 09:29:00 -0400
commit6f481e3cefeb33094e87af176587e6a3027f104e (patch)
tree676ee530f74210d0518b519036594a7bdb64e1af /drivers/scsi/iscsi_tcp.c
parent8e12452549ba2dfa17db97bc495172fac221a7ab (diff)
[SCSI] iscsi_tcp: return a descriptive error value during connection errors
The segment->done functions return a iscsi error value which gives a lot more info than conn failed, so this patch has us return that value. I also add a new one for xmit failures. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/iscsi_tcp.c')
-rw-r--r--drivers/scsi/iscsi_tcp.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 4f096de81525..ed6c54cae7b1 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -979,7 +979,7 @@ iscsi_tcp_recv(read_descriptor_t *rd_desc, struct sk_buff *skb,
979 979
980error: 980error:
981 debug_tcp("Error receiving PDU, errno=%d\n", rc); 981 debug_tcp("Error receiving PDU, errno=%d\n", rc);
982 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); 982 iscsi_conn_failure(conn, rc);
983 return 0; 983 return 0;
984} 984}
985 985
@@ -1098,8 +1098,10 @@ iscsi_xmit(struct iscsi_conn *conn)
1098 1098
1099 while (1) { 1099 while (1) {
1100 rc = iscsi_tcp_xmit_segment(tcp_conn, segment); 1100 rc = iscsi_tcp_xmit_segment(tcp_conn, segment);
1101 if (rc < 0) 1101 if (rc < 0) {
1102 rc = ISCSI_ERR_XMIT_FAILED;
1102 goto error; 1103 goto error;
1104 }
1103 if (rc == 0) 1105 if (rc == 0)
1104 break; 1106 break;
1105 1107
@@ -1108,7 +1110,7 @@ iscsi_xmit(struct iscsi_conn *conn)
1108 if (segment->total_copied >= segment->total_size) { 1110 if (segment->total_copied >= segment->total_size) {
1109 if (segment->done != NULL) { 1111 if (segment->done != NULL) {
1110 rc = segment->done(tcp_conn, segment); 1112 rc = segment->done(tcp_conn, segment);
1111 if (rc < 0) 1113 if (rc != 0)
1112 goto error; 1114 goto error;
1113 } 1115 }
1114 } 1116 }
@@ -1123,8 +1125,8 @@ error:
1123 /* Transmit error. We could initiate error recovery 1125 /* Transmit error. We could initiate error recovery
1124 * here. */ 1126 * here. */
1125 debug_tcp("Error sending PDU, errno=%d\n", rc); 1127 debug_tcp("Error sending PDU, errno=%d\n", rc);
1126 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); 1128 iscsi_conn_failure(conn, rc);
1127 return rc; 1129 return -EIO;
1128} 1130}
1129 1131
1130/** 1132/**