NVMf: Handle the memory leak issue of nvmf tgt
Reason: In acceptor_poller_unregistered_event, we directly call spdk_nvmf_check_pools and spdk_app_stop, it will fail the memory check. And function nvmf_delete_subsystem_poller_unreg will not be called since we already call spdk_app_stop. Change-Id: I3ffa30c87b149a66cee1d87d1bb81d4dc8cc96b9 Signed-off-by: Ziye Yang <ziye.yang@intel.com>
This commit is contained in:
parent
dadbf52dda
commit
9f2fc78e3f
@ -64,15 +64,9 @@ static struct spdk_poller *g_acceptor_poller = NULL;
|
||||
static void
|
||||
acceptor_poller_unregistered_event(struct spdk_event *event)
|
||||
{
|
||||
int rc;
|
||||
|
||||
spdk_nvmf_acceptor_fini();
|
||||
spdk_nvmf_transport_fini();
|
||||
spdk_shutdown_nvmf_subsystems();
|
||||
|
||||
rc = spdk_nvmf_check_pools();
|
||||
|
||||
spdk_app_stop(rc);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -44,6 +44,7 @@
|
||||
#include "spdk/nvmf_spec.h"
|
||||
|
||||
static TAILQ_HEAD(, spdk_nvmf_subsystem) g_subsystems = TAILQ_HEAD_INITIALIZER(g_subsystems);
|
||||
bool g_subsystems_shutdown;
|
||||
|
||||
struct spdk_nvmf_subsystem *
|
||||
nvmf_find_subsystem(const char *subnqn, const char *hostnqn)
|
||||
@ -195,6 +196,10 @@ nvmf_delete_subsystem_poller_unreg(struct spdk_event *event)
|
||||
TAILQ_REMOVE(&g_subsystems, subsystem, entries);
|
||||
|
||||
free(subsystem);
|
||||
|
||||
if (g_subsystems_shutdown && TAILQ_EMPTY(&g_subsystems)) {
|
||||
spdk_app_stop(spdk_nvmf_check_pools());
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
@ -336,6 +341,7 @@ spdk_shutdown_nvmf_subsystems(void)
|
||||
{
|
||||
struct spdk_nvmf_subsystem *subsystem, *subsys_tmp;
|
||||
|
||||
g_subsystems_shutdown = true;
|
||||
TAILQ_FOREACH_SAFE(subsystem, &g_subsystems, entries, subsys_tmp) {
|
||||
nvmf_delete_subsystem(subsystem);
|
||||
}
|
||||
|
@ -47,6 +47,17 @@ SPDK_LOG_REGISTER_TRACE_FLAG("nvmf", SPDK_TRACE_NVMF)
|
||||
|
||||
struct spdk_nvmf_globals g_nvmf_tgt;
|
||||
|
||||
void
|
||||
spdk_app_stop(int rc)
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
spdk_nvmf_check_pools(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
spdk_app_get_current_core(void)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user