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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I28c4f5e29f0dfd72436b0131e09f9707822165fc Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477630 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
parent
f29c728980
commit
83bcd693b0
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user