lib/iscsi: Get IO trace ISCSI_TASK_EXECUTED before PDU is freed

IO trace ISCSI_TASK_EXECUTED was taken after PDU was freed.
spdk_trace_record() doesn't dereference the passed pointers and it's fine,
but get the trace before PDU is freed to make the coder clearer.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I53a19dbd85e9599c4fa9d7458b5344cff9c76ea2
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471203
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Shuhei Matsumoto 2019-10-14 08:48:25 +09:00 committed by Tomasz Zawadzki
parent d7c4a20f52
commit 349b772415

View File

@ -1409,12 +1409,14 @@ iscsi_conn_handle_incoming_pdus(struct spdk_iscsi_conn *conn)
}
rc = spdk_iscsi_execute(conn, pdu);
if (rc == 0) {
spdk_trace_record(TRACE_ISCSI_TASK_EXECUTED, 0, 0, (uintptr_t)pdu, 0);
}
spdk_put_pdu(pdu);
if (rc < 0) {
return SPDK_ISCSI_CONNECTION_FATAL;
}
spdk_trace_record(TRACE_ISCSI_TASK_EXECUTED, 0, 0, (uintptr_t)pdu, 0);
if (conn->is_stopped) {
break;
}