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 <lance.hartmann@oracle.com> Reviewed-on: https://review.gerrithub.io/404034 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
35260f2b40
commit
6450f07e4d
@ -531,13 +531,10 @@ spdk_iscsi_read_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu **_pdu)
|
|||||||
spdk_put_pdu(pdu);
|
spdk_put_pdu(pdu);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If PDU was rejected successfully and thus not will
|
* If spdk_iscsi_reject() was not able to reject the PDU,
|
||||||
* not be returned to the caller for execution,
|
* treat it as a fatal connection error. Otherwise,
|
||||||
* we will not drop the connection and hence return
|
* return SUCCESS here so that the caller will continue
|
||||||
* SUCCESS here so that the caller will continue
|
* to attempt to read PDUs.
|
||||||
* to attempt to read PDUs. If, however, the
|
|
||||||
* reject failed, then return a failure to the
|
|
||||||
* caller.
|
|
||||||
*/
|
*/
|
||||||
rc = (rc < 0) ? SPDK_ISCSI_CONNECTION_FATAL :
|
rc = (rc < 0) ? SPDK_ISCSI_CONNECTION_FATAL :
|
||||||
SPDK_SUCCESS;
|
SPDK_SUCCESS;
|
||||||
@ -3826,7 +3823,6 @@ spdk_iscsi_handle_status_snack(struct spdk_iscsi_conn *conn,
|
|||||||
uint32_t last_statsn;
|
uint32_t last_statsn;
|
||||||
bool found_pdu;
|
bool found_pdu;
|
||||||
struct spdk_iscsi_pdu *old_pdu;
|
struct spdk_iscsi_pdu *old_pdu;
|
||||||
int rc;
|
|
||||||
|
|
||||||
reqh = (struct iscsi_bhs_snack_req *)&pdu->bhs;
|
reqh = (struct iscsi_bhs_snack_req *)&pdu->bhs;
|
||||||
beg_run = from_be32(&reqh->beg_run);
|
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",
|
"but already got ExpStatSN: 0x%08x on CID:%hu.\n",
|
||||||
beg_run, run_length, conn->StatSN, conn->cid);
|
beg_run, run_length, conn->StatSN, conn->cid);
|
||||||
|
|
||||||
rc = spdk_iscsi_reject(conn, pdu, ISCSI_REASON_INVALID_PDU_FIELD);
|
return spdk_iscsi_reject(conn, pdu, ISCSI_REASON_INVALID_PDU_FIELD);
|
||||||
return rc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
last_statsn = (!run_length) ? conn->StatSN : (beg_run + run_length);
|
last_statsn = (!run_length) ? conn->StatSN : (beg_run + run_length);
|
||||||
|
Loading…
Reference in New Issue
Block a user