ftl: free allocated IO queue pair before releasing the controller

Intermittent FTL test failure (ASAN) #717 reported an error, in
ftl_halt_poller() call, ftl_anm_unregister_device() will release
controller first, while in ftl_dev_free_sync() the IO queue pair
will be released again.

Change-Id: Ifac2aa68e66ee5f41eba80c11c61d9dc91ec3408
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448524 (master)
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448827
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Changpeng Liu 2019-03-20 04:57:43 -04:00 committed by Jim Harris
parent d1a00ccd13
commit 6d8f66269d

View File

@ -964,9 +964,6 @@ ftl_dev_free_sync(struct spdk_ftl_dev *dev)
}
pthread_mutex_unlock(&g_ftl_queue_lock);
ftl_dev_free_thread(dev, &dev->read_thread);
ftl_dev_free_thread(dev, &dev->core_thread);
assert(LIST_EMPTY(&dev->wptr_list));
ftl_dev_dump_bands(dev);
@ -1004,6 +1001,9 @@ ftl_halt_poller(void *ctx)
if (!dev->core_thread.poller && !dev->read_thread.poller) {
spdk_poller_unregister(&dev->halt_poller);
ftl_dev_free_thread(dev, &dev->read_thread);
ftl_dev_free_thread(dev, &dev->core_thread);
ftl_anm_unregister_device(dev);
ftl_dev_free_sync(dev);