Commit 38980ded authored by Ziye Yang's avatar Ziye Yang Committed by Daniel Verkamp
Browse files

nvmf,tgt: fix issue while shutting down nvmf tgt with CTRL + C



The phenoemon is that we can not shutdown the nvmf tgt.
The solution is that we need to adjust the shutting down orders of
nvmf tgt subsystem and rdma trasport layer.

Change-Id: Ie39657370b1574960e0ee7cf604cc5872db0bed3
Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
parent 08238af7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ subsystem_delete_event(void *arg1, void *arg2)
	spdk_nvmf_delete_subsystem(subsystem);

	if (g_subsystems_shutdown && TAILQ_EMPTY(&g_subsystems)) {
		spdk_nvmf_tgt_fini();
		/* Finished shutting down all subsystems - continue the shutdown process. */
		shutdown_complete();
	}
@@ -118,7 +119,6 @@ shutdown_subsystems(void)
static void
acceptor_poller_unregistered_event(void *arg1, void *arg2)
{
	spdk_nvmf_tgt_fini();
	shutdown_subsystems();
}

+2 −0
Original line number Diff line number Diff line
@@ -1012,6 +1012,8 @@ static int
spdk_nvmf_rdma_fini(void)
{
	pthread_mutex_lock(&g_rdma.lock);

	assert(TAILQ_EMPTY(&g_rdma.listen_addrs));
	if (g_rdma.event_channel != NULL) {
		rdma_destroy_event_channel(g_rdma.event_channel);
	}