lib/iscsi: Unify error log of spdk_iscsi_execute()
We can unify several error logs of spdk_iscsi_execute() failure into a single error log. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I1dd6a7312e5c615c478771beb89fd44fdb1710c1 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470286 Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
df46a0b893
commit
5f37368f19
@ -1411,9 +1411,6 @@ iscsi_conn_handle_incoming_pdus(struct spdk_iscsi_conn *conn)
|
||||
rc = spdk_iscsi_execute(conn, pdu);
|
||||
spdk_put_pdu(pdu);
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_iscsi_execute() fatal error on %s(%s)\n",
|
||||
conn->target_port != NULL ? spdk_scsi_port_get_name(conn->target_port) : "NULL",
|
||||
conn->initiator_port != NULL ? spdk_scsi_port_get_name(conn->initiator_port) : "NULL");
|
||||
return SPDK_ISCSI_CONNECTION_FATAL;
|
||||
}
|
||||
|
||||
|
@ -4545,57 +4545,29 @@ spdk_iscsi_execute(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
|
||||
switch (opcode) {
|
||||
case ISCSI_OP_NOPOUT:
|
||||
rc = iscsi_op_nopout(conn, pdu);
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_iscsi_op_nopout() failed\n");
|
||||
return rc;
|
||||
}
|
||||
break;
|
||||
|
||||
case ISCSI_OP_SCSI:
|
||||
rc = iscsi_op_scsi(conn, pdu);
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_iscsi_op_scsi() failed\n");
|
||||
return rc;
|
||||
}
|
||||
break;
|
||||
case ISCSI_OP_TASK:
|
||||
rc = iscsi_op_task(conn, pdu);
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_iscsi_op_task() failed\n");
|
||||
return rc;
|
||||
}
|
||||
break;
|
||||
|
||||
case ISCSI_OP_TEXT:
|
||||
rc = iscsi_op_text(conn, pdu);
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_iscsi_op_text() failed\n");
|
||||
return rc;
|
||||
}
|
||||
break;
|
||||
|
||||
case ISCSI_OP_LOGOUT:
|
||||
rc = iscsi_op_logout(conn, pdu);
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_iscsi_op_logout() failed\n");
|
||||
return rc;
|
||||
}
|
||||
break;
|
||||
|
||||
case ISCSI_OP_SCSI_DATAOUT:
|
||||
rc = iscsi_op_data(conn, pdu);
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_iscsi_op_data() failed\n");
|
||||
return rc;
|
||||
}
|
||||
break;
|
||||
|
||||
case ISCSI_OP_SNACK:
|
||||
rc = iscsi_op_snack(conn, pdu);
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_iscsi_op_snack() failed\n");
|
||||
return rc;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -4603,7 +4575,14 @@ spdk_iscsi_execute(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
|
||||
return iscsi_reject(conn, pdu, ISCSI_REASON_PROTOCOL_ERROR);
|
||||
}
|
||||
|
||||
return 0;
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("processing PDU (opcode=%x) failed on %s(%s)\n",
|
||||
opcode,
|
||||
conn->target_port != NULL ? spdk_scsi_port_get_name(conn->target_port) : "NULL",
|
||||
conn->initiator_port != NULL ? spdk_scsi_port_get_name(conn->initiator_port) : "NULL");
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int
|
||||
|
Loading…
Reference in New Issue
Block a user