From: Javier González Date: Mon, 16 Nov 2015 14:34:47 +0000 (+0100) Subject: lightnvm: cleanup queue before target removal X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d09f9581b235a92abbe372531660b468fadabc17;p=linux-beck.git lightnvm: cleanup queue before target removal This prevents outstanding IOs to be sent for completion to target after the target has been removed. The flow is now: stop new IOs > cleanup queue > remove target. Signed-off-by: Javier Gonzalez Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe --- diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index 790b1d7a8d43..8a556f3f36bb 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c @@ -460,11 +460,11 @@ static void nvm_remove_target(struct nvm_target *t) lockdep_assert_held(&nvm_lock); del_gendisk(tdisk); + blk_cleanup_queue(q); + if (tt->exit) tt->exit(tdisk->private_data); - blk_cleanup_queue(q); - put_disk(tdisk); list_del(&t->list);