Commit c9c80e69 authored by Evgeniy Kochetov's avatar Evgeniy Kochetov Committed by Ben Walker
Browse files

nvmf/rpc: Fix io channel reference counting in NVMf statistics



NVMf statistics functions use spdk_get_io_channel function to get a
poll group. It increases reference counter in io channel and causes
problems on application exit. spdk_put_io_channel calls were added to
release the channel.

Signed-off-by: default avatarEvgeniy Kochetov <evgeniik@mellanox.com>
Change-Id: I832d1eae346c3bc3858ed0ed063ff7a7a897a2f5
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463389


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent dcbe9e42
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1242,5 +1242,6 @@ spdk_nvmf_poll_group_get_stat(struct spdk_nvmf_tgt *tgt,
	ch = spdk_get_io_channel(tgt);
	group = spdk_io_channel_get_ctx(ch);
	*stat = group->stat;
	spdk_put_io_channel(ch);
	return 0;
}
+1 −0
Original line number Diff line number Diff line
@@ -3698,6 +3698,7 @@ spdk_nvmf_rdma_poll_group_get_stat(struct spdk_nvmf_tgt *tgt,

	ch = spdk_get_io_channel(tgt);
	group = spdk_io_channel_get_ctx(ch);;
	spdk_put_io_channel(ch);
	TAILQ_FOREACH(tgroup, &group->tgroups, link) {
		if (SPDK_NVME_TRANSPORT_RDMA == tgroup->transport->ops->type) {
			*stat = calloc(1, sizeof(struct spdk_nvmf_transport_poll_group_stat));