diff --git a/lib/iscsi/conn.c b/lib/iscsi/conn.c index fb6df92f4..c439fa697 100644 --- a/lib/iscsi/conn.c +++ b/lib/iscsi/conn.c @@ -1405,14 +1405,7 @@ iscsi_conn_handle_incoming_pdus(struct spdk_iscsi_conn *conn) if (rc == 0) { break; } else if (rc < 0) { - SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "Failed to read pdu, error=%d\n", rc); - return SPDK_ISCSI_CONNECTION_FATAL; - } - - if (conn->is_logged_out) { - SPDK_ERRLOG("pdu received after logout\n"); - spdk_put_pdu(pdu); - return SPDK_ISCSI_CONNECTION_FATAL; + return rc; } rc = spdk_iscsi_execute(conn, pdu); diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c index d19f90132..2ab7d346f 100644 --- a/lib/iscsi/iscsi.c +++ b/lib/iscsi/iscsi.c @@ -4683,7 +4683,6 @@ spdk_iscsi_read_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu **_pdu) } else { SPDK_ERRLOG("Data(%d) > MaxSegment(%d)\n", data_len, SPDK_ISCSI_MAX_RECV_DATA_SEGMENT_LENGTH); - rc = SPDK_ISCSI_CONNECTION_FATAL; goto error; } pdu->mobj = spdk_mempool_get(pool); @@ -4741,7 +4740,6 @@ spdk_iscsi_read_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu **_pdu) rc = MATCH_DIGEST_WORD(pdu->header_digest, crc32c); if (rc == 0) { SPDK_ERRLOG("header digest error (%s)\n", conn->initiator_name); - rc = SPDK_ISCSI_CONNECTION_FATAL; goto error; } } @@ -4749,19 +4747,24 @@ spdk_iscsi_read_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu **_pdu) crc32c = spdk_iscsi_pdu_calc_data_digest(pdu); rc = MATCH_DIGEST_WORD(pdu->data_digest, crc32c); if (rc == 0) { - rc = SPDK_ISCSI_CONNECTION_FATAL; SPDK_ERRLOG("data digest error (%s)\n", conn->initiator_name); goto error; } } + if (conn->is_logged_out) { + SPDK_ERRLOG("pdu received after logout\n"); + spdk_put_pdu(pdu); + return SPDK_ISCSI_CONNECTION_FATAL; + } + *_pdu = pdu; return 1; error: spdk_put_pdu(pdu); conn->pdu_in_progress = NULL; - return rc; + return SPDK_ISCSI_CONNECTION_FATAL; } bool