diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2006-07-24 16:47:45 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-07-28 12:49:50 -0400 |
commit | 40527afea1a3b18ee5754e17d6f807176e03f1f2 (patch) | |
tree | 940bc089d28a5fe37ea2bae4b5532b090d9598e3 /drivers | |
parent | c8dc1e523b0f1e6dd71cdabd8c7d7587c6dc27f9 (diff) |
[SCSI] iscsi bugfixes: pass errors from complete_pdu to caller
Must pass ISCSI_ERR values from the recv path and propogate them
upwards.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/iscsi_tcp.c | 2 | ||||
-rw-r--r-- | drivers/scsi/libiscsi.c | 27 |
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()*/ |