nvmf: Only send message on qpair disconnect if on wrong thread

Change-Id: I5297c7a869402c96f69d705a13529c32296a9eaa
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/415314
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Ben Walker 2018-06-14 10:42:19 -07:00 committed by Jim Harris
parent 878185cf0e
commit 1a6d593345

View File

@ -672,8 +672,12 @@ _spdk_nvmf_qpair_deactivate(void *ctx)
void
spdk_nvmf_qpair_disconnect(struct spdk_nvmf_qpair *qpair)
{
/* Send a message to the thread that owns this qpair */
spdk_thread_send_msg(qpair->group->thread, _spdk_nvmf_qpair_deactivate, qpair);
if (qpair->group->thread == spdk_get_thread()) {
_spdk_nvmf_qpair_deactivate(qpair);
} else {
/* Send a message to the thread that owns this qpair */
spdk_thread_send_msg(qpair->group->thread, _spdk_nvmf_qpair_deactivate, qpair);
}
}
int