Commit 22555339 authored by Jim Harris's avatar Jim Harris Committed by Daniel Verkamp
Browse files

bdev: remove shared_resource from TAILQ before putting io channel



Normally, the put_io_channel is deferred - but for unit tests
messages are called inline and not as events.  This results
in spdk_bdev_mgmt_channel_destroy() complaining that
the shared_resource list isn't empty.

So just remove it from the TAILQ before putting the io_channel -
that's more correct anyways.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: Ifd3418f208c906ac09822cb9202068baf0fe211a

Reviewed-on: https://review.gerrithub.io/415529


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 7699cdee
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1172,8 +1172,8 @@ _spdk_bdev_channel_destroy_resource(struct spdk_bdev_channel *ch)
		shared_resource->ref--;
		if (shared_resource->ref == 0) {
			assert(shared_resource->io_outstanding == 0);
			spdk_put_io_channel(spdk_io_channel_from_ctx(shared_resource->mgmt_ch));
			TAILQ_REMOVE(&shared_resource->mgmt_ch->shared_resources, shared_resource, link);
			spdk_put_io_channel(spdk_io_channel_from_ctx(shared_resource->mgmt_ch));
			free(shared_resource);
		}
	}