lib/ftl: Add check if device is halted during reloc

It's possible there's a delay between spdk_ftl_dev_free setting
dev->halt and sending message to core thread which would set
reloc->halt. This patch should bridge this gap and prevent potential
additional/unneeded relocations from happening.

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: I3d69fe86900c9233fadd8e3795accb36b1c01791
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461598
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Mateusz Kozlowski 2019-07-12 13:32:44 +02:00 committed by Jim Harris
parent 7384ca015b
commit 4d9faf7c6b

View File

@ -1295,6 +1295,7 @@ static void
ftl_add_halt_poller(void *ctx)
{
struct spdk_ftl_dev *dev = ctx;
dev->halt = 1;
_ftl_halt_defrag(dev);
@ -1313,7 +1314,6 @@ _spdk_ftl_dev_free(struct spdk_ftl_dev *dev, spdk_ftl_init_fn cb_fn, void *cb_ar
dev->fini_ctx.cb_fn = cb_fn;
dev->fini_ctx.cb_arg = cb_arg;
dev->fini_ctx.thread = thread;
dev->halt = 1;
ftl_rwb_disable_interleaving(dev->rwb);