aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/iscsi_tcp.c2
-rw-r--r--drivers/scsi/libiscsi.c27
2 files changed, 19 insertions, 10 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index aa20adc79f02..33534f686434 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -885,7 +885,7 @@ more:
885 } 885 }
886 tcp_conn->in_progress = IN_PROGRESS_DATA_RECV; 886 tcp_conn->in_progress = IN_PROGRESS_DATA_RECV;
887 } else if (rc) { 887 } else if (rc) {
888 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); 888 iscsi_conn_failure(conn, rc);
889 return 0; 889 return 0;
890 } 890 }
891 } 891 }
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 03b3dee49009..c628c63c51a8 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -372,7 +372,8 @@ int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
372 * login related PDU's exp_statsn is handled in 372 * login related PDU's exp_statsn is handled in
373 * userspace 373 * userspace
374 */ 374 */
375 rc = iscsi_recv_pdu(conn->cls_conn, hdr, data, datalen); 375 if (iscsi_recv_pdu(conn->cls_conn, hdr, data, datalen))
376 rc = ISCSI_ERR_CONN_FAILED;
376 list_del(&mtask->running); 377 list_del(&mtask->running);
377 if (conn->login_mtask != mtask) 378 if (conn->login_mtask != mtask)
378 __kfifo_put(session->mgmtpool.queue, 379 __kfifo_put(session->mgmtpool.queue,
@@ -393,7 +394,8 @@ int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
393 } 394 }
394 conn->exp_statsn = be32_to_cpu(hdr->statsn) + 1; 395 conn->exp_statsn = be32_to_cpu(hdr->statsn) + 1;
395 396
396 rc = iscsi_recv_pdu(conn->cls_conn, hdr, data, datalen); 397 if (iscsi_recv_pdu(conn->cls_conn, hdr, data, datalen))
398 rc = ISCSI_ERR_CONN_FAILED;
397 list_del(&mtask->running); 399 list_del(&mtask->running);
398 if (conn->login_mtask != mtask) 400 if (conn->login_mtask != mtask)
399 __kfifo_put(session->mgmtpool.queue, 401 __kfifo_put(session->mgmtpool.queue,
@@ -406,14 +408,21 @@ int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
406 } else if (itt == ISCSI_RESERVED_TAG) { 408 } else if (itt == ISCSI_RESERVED_TAG) {
407 switch(opcode) { 409 switch(opcode) {
408 case ISCSI_OP_NOOP_IN: 410 case ISCSI_OP_NOOP_IN:
409 if (!datalen) { 411 if (datalen) {
410 rc = iscsi_check_assign_cmdsn(session,
411 (struct iscsi_nopin*)hdr);
412 if (!rc && hdr->ttt != ISCSI_RESERVED_TAG)
413 rc = iscsi_recv_pdu(conn->cls_conn,
414 hdr, NULL, 0);
415 } else
416 rc = ISCSI_ERR_PROTO; 412 rc = ISCSI_ERR_PROTO;
413 break;
414 }
415
416 rc = iscsi_check_assign_cmdsn(session,
417 (struct iscsi_nopin*)hdr);
418 if (rc)
419 break;
420
421 if (hdr->ttt == ISCSI_RESERVED_TAG)
422 break;
423
424 if (iscsi_recv_pdu(conn->cls_conn, hdr, NULL, 0))
425 rc = ISCSI_ERR_CONN_FAILED;
417 break; 426 break;
418 case ISCSI_OP_REJECT: 427 case ISCSI_OP_REJECT:
419 /* we need sth like iscsi_reject_rsp()*/ 428 /* we need sth like iscsi_reject_rsp()*/