From ae0f518e4ff841de9835b8994f17542c980df0a5 Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk Date: Wed, 18 Oct 2017 21:24:25 +0200 Subject: [PATCH] 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 Reviewed-on: https://review.gerrithub.io/383018 Reviewed-by: Daniel Verkamp Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris --- examples/bdev/fio_plugin/fio_plugin.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/bdev/fio_plugin/fio_plugin.c b/examples/bdev/fio_plugin/fio_plugin.c index 37cfd1a72..0569f37e2 100644 --- a/examples/bdev/fio_plugin/fio_plugin.c +++ b/examples/bdev/fio_plugin/fio_plugin.c @@ -165,13 +165,10 @@ 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); } - TAILQ_REMOVE(&fio_thread->pollers, fio_poller, link); - free(fio_poller); *ppoller = NULL; }