From 6450f07e4db13abc44e339d4809a8a2ec9e0fbf8 Mon Sep 17 00:00:00 2001 From: Lance Hartmann Date: Thu, 15 Mar 2018 17:18:57 -0400 Subject: [PATCH] iscsi: Re-word comment, simplify a return. Re-word confusing comment in spdk_iscsi_read_pdu() and simplify a return path in spdk_iscsi_handle_status_snack(). Change-Id: I15bd8b2f45d0e45cf4a4a34533ecb8af0a154531 Signed-off-by: Lance Hartmann Reviewed-on: https://review.gerrithub.io/404034 Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp Reviewed-by: Jim Harris --- lib/iscsi/iscsi.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c index e79dce24a..b69f77bf4 100644 --- a/lib/iscsi/iscsi.c +++ b/lib/iscsi/iscsi.c @@ -531,13 +531,10 @@ spdk_iscsi_read_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu **_pdu) spdk_put_pdu(pdu); /* - * If PDU was rejected successfully and thus not will - * not be returned to the caller for execution, - * we will not drop the connection and hence return - * SUCCESS here so that the caller will continue - * to attempt to read PDUs. If, however, the - * reject failed, then return a failure to the - * caller. + * If spdk_iscsi_reject() was not able to reject the PDU, + * treat it as a fatal connection error. Otherwise, + * return SUCCESS here so that the caller will continue + * to attempt to read PDUs. */ rc = (rc < 0) ? SPDK_ISCSI_CONNECTION_FATAL : SPDK_SUCCESS; @@ -3826,7 +3823,6 @@ spdk_iscsi_handle_status_snack(struct spdk_iscsi_conn *conn, uint32_t last_statsn; bool found_pdu; struct spdk_iscsi_pdu *old_pdu; - int rc; reqh = (struct iscsi_bhs_snack_req *)&pdu->bhs; beg_run = from_be32(&reqh->beg_run); @@ -3843,8 +3839,7 @@ spdk_iscsi_handle_status_snack(struct spdk_iscsi_conn *conn, "but already got ExpStatSN: 0x%08x on CID:%hu.\n", beg_run, run_length, conn->StatSN, conn->cid); - rc = spdk_iscsi_reject(conn, pdu, ISCSI_REASON_INVALID_PDU_FIELD); - return rc; + return spdk_iscsi_reject(conn, pdu, ISCSI_REASON_INVALID_PDU_FIELD); } last_statsn = (!run_length) ? conn->StatSN : (beg_run + run_length);