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

thread: assert if io_device_unregister cannot find device



The bdev iscsi initiator had a bug which resulted in
an io_device getting unregistered twice.  An error message
got printed but it didn't immediately result in any kind
of failure detected by any tests.  Really this should be
considered a fatal error, so add an assert() so it's found
more readily should these kinds of bugs occur again in the
future.

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

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


Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
parent 22555339
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -388,6 +388,7 @@ spdk_io_device_unregister(void *io_device, spdk_io_device_unregister_cb unregist

	if (!dev) {
		SPDK_ERRLOG("io_device %p not found\n", io_device);
		assert(false);
		pthread_mutex_unlock(&g_devlist_mutex);
		return;
	}
+0 −1
Original line number Diff line number Diff line
@@ -400,7 +400,6 @@ channel(void)

	spdk_io_device_unregister(&device1, NULL);
	spdk_io_device_unregister(&device2, NULL);
	spdk_io_device_unregister(&device3, NULL);
	CU_ASSERT(TAILQ_EMPTY(&g_io_devices));
	spdk_free_thread();
	CU_ASSERT(TAILQ_EMPTY(&g_threads));