lib/scsi: Assert if ref count of task goes negative

We didn't have any check if ref count of SCSI task doesn't go negative.
This addition will verify the idea to LUN hotplug issue by subsequent
patches.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I1d6ca9b9439bc7c4b701b65cc004cdf5cae16e91
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473585
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Shuhei Matsumoto 2019-11-08 07:17:18 +09:00 committed by Tomasz Zawadzki
parent 3d8c12a16f
commit b386a3a9a2

View File

@ -47,6 +47,7 @@ spdk_scsi_task_put(struct spdk_scsi_task *task)
return;
}
assert(task->ref > 0);
task->ref--;
if (task->ref == 0) {