lib/iscsi: Free session pool after all connections are exited

Global session pool had been freed immediately after starting
connection shutdown.  iSCSI connection shutdown is asynchronous.
It will be safe to free global session pool after completion of
all connections shutdown.  Hence move free(g_spdk_iscsi.session)
from spdk_iscsi_fini() to _iscsi_fini_dev_unreg().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I4c16930a0e861a190115049cba3739ec01f0a8a2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/494
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Shuhei Matsumoto 2019-12-24 00:53:17 -05:00 committed by Tomasz Zawadzki
parent de5f1ea0ba
commit 16724dc135

View File

@ -1386,7 +1386,6 @@ spdk_iscsi_fini(spdk_iscsi_fini_cb cb_fn, void *cb_arg)
spdk_iscsi_portal_grp_close_all();
spdk_shutdown_iscsi_conns();
free(g_spdk_iscsi.session);
}
static void
@ -1404,6 +1403,7 @@ _iscsi_fini_dev_unreg(struct spdk_io_channel_iter *i, int status)
{
iscsi_check_pools();
iscsi_free_pools();
free(g_spdk_iscsi.session);
assert(TAILQ_EMPTY(&g_spdk_iscsi.poll_group_head));