diff options
-rw-r--r-- | drivers/scsi/iscsi_tcp.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index b7c092d63bbe..518dbd91df85 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c | |||
@@ -253,8 +253,6 @@ static int iscsi_sw_tcp_xmit_segment(struct iscsi_tcp_conn *tcp_conn, | |||
253 | 253 | ||
254 | if (r < 0) { | 254 | if (r < 0) { |
255 | iscsi_tcp_segment_unmap(segment); | 255 | iscsi_tcp_segment_unmap(segment); |
256 | if (copied || r == -EAGAIN) | ||
257 | break; | ||
258 | return r; | 256 | return r; |
259 | } | 257 | } |
260 | copied += r; | 258 | copied += r; |
@@ -275,11 +273,17 @@ static int iscsi_sw_tcp_xmit(struct iscsi_conn *conn) | |||
275 | 273 | ||
276 | while (1) { | 274 | while (1) { |
277 | rc = iscsi_sw_tcp_xmit_segment(tcp_conn, segment); | 275 | rc = iscsi_sw_tcp_xmit_segment(tcp_conn, segment); |
278 | if (rc < 0) { | 276 | /* |
277 | * We may not have been able to send data because the conn | ||
278 | * is getting stopped. libiscsi will know so propogate err | ||
279 | * for it to do the right thing. | ||
280 | */ | ||
281 | if (rc == -EAGAIN) | ||
282 | return rc; | ||
283 | else if (rc < 0) { | ||
279 | rc = ISCSI_ERR_XMIT_FAILED; | 284 | rc = ISCSI_ERR_XMIT_FAILED; |
280 | goto error; | 285 | goto error; |
281 | } | 286 | } else if (rc == 0) |
282 | if (rc == 0) | ||
283 | break; | 287 | break; |
284 | 288 | ||
285 | consumed += rc; | 289 | consumed += rc; |