fio_plugin: allow stopping poller after it's thread has been stopped

Patch 2b37c71 [1] introduced the
spdk_bdev_finish() call on the
fio_plugin shutdown. That happens
after all the fio threads have
stopped. Patch 19ddb10 [2] introduces
an extra poller that has to be
stopped during spdk_bdev_finish().
Prior to this patch fio_plugin
pollers couldn't be stopped if their
corresponding threads have been
already stopped - but that's a
behavior we want.

[1] 2b37c71 ("bdev/fio_plugin: add call spdk_bdev_finish")
[2] 19ddb10 ("bdev_virtio: implement controlq and RESETs")

Change-Id: I415d6f8a564ddd70a4e50f149e85f2765f036b4d
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/383018
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Dariusz Stojaczyk 2017-10-18 21:24:25 +02:00 committed by Jim Harris
parent 32f7f2af23
commit ae0f518e4f

View File

@ -165,12 +165,9 @@ spdk_fio_stop_poller(struct spdk_bdev_poller **ppoller)
fio_poller = *(struct spdk_fio_poller **)ppoller;
fio_thread = g_thread;
if (!fio_thread) {
SPDK_ERRLOG("Expected local thread to be initialized, but it was not.\n");
return;
}
if (fio_thread) {
TAILQ_REMOVE(&fio_thread->pollers, fio_poller, link);
}
free(fio_poller);
*ppoller = NULL;