Commit 83bcd693 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

lib/iscsi: Assert if PDU ref count goes negative



Error log had been collected if PDU ref count went negative. However,
error log is not easy to notice.  SPDK iSCSI target is more stable
than before and SPDK iSCSI task has such assert.  Hence replace
error log by assert for PDU.

Signed-off-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I28c4f5e29f0dfd72436b0131e09f9707822165fc
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477630


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent f29c7289
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -294,13 +294,9 @@ void spdk_put_pdu(struct spdk_iscsi_pdu *pdu)
		return;
	}

	assert(pdu->ref > 0);
	pdu->ref--;

	if (pdu->ref < 0) {
		SPDK_ERRLOG("Negative PDU refcount: %p\n", pdu);
		pdu->ref = 0;
	}

	if (pdu->ref == 0) {
		if (pdu->mobj) {
			spdk_mempool_put(pdu->mobj->mp, (void *)pdu->mobj);