Commit 349b7724 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

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: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I53a19dbd85e9599c4fa9d7458b5344cff9c76ea2
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471203


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent d7c4a20f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;
		}