When a queue has finished processing on its polling thread, it sends a message to the app thread signaling that it is done. Then when the app thread gets messages from all of the queues for that device, it can proceed with tearing the device down. But if there are still ctrl_ring commands in progress, it needs to wait. Previously it would register a poller that would retry the same function if it found commands in progress. But the problem is that it did not differentiate the function getting called as a direct message from the polling thread vs. retried via the poller on the app thread. This could result in lost messages. So fix it to always increment the queues_closed counter (renamed from q_deinit_num), and then only check for ctrl ring commands in progress after we received all of the queue closed messages. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I0ea23ebc69acb29d5ab7e1d86ddbe74b9973e225 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16405 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Michal Berger <michal.berger@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com> |
||
---|---|---|
.. | ||
Makefile | ||
spdk_ublk.map | ||
ublk_internal.h | ||
ublk_rpc.c | ||
ublk.c |