diff options
author | Sagi Grimberg <sagi@grimberg.me> | 2017-01-01 13:41:56 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-12-09 22:01:54 +0100 |
commit | 3976dd677e891c0b2c63d08028d445663539472c (patch) | |
tree | 4a2bc79d6357124faf90795d582ca0152ac0bd33 /drivers/nvme | |
parent | 6bd89953fb1f8e45dc9f93ab59f50c950ef44187 (diff) |
nvmet: cancel fatal error and flush async work before free controller
[ Upstream commit 06406d81a2d7cfb8abcc4fa6cdfeb8e5897007c5 ]
Make sure they are not running and we can free the controller
safely.
Signed-off-by: Roy Shterman <roys@lightbitslabs.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/target/core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index 55ce769cecee..fbd6d487103f 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c @@ -816,6 +816,9 @@ static void nvmet_ctrl_free(struct kref *ref) list_del(&ctrl->subsys_entry); mutex_unlock(&subsys->lock); + flush_work(&ctrl->async_event_work); + cancel_work_sync(&ctrl->fatal_err_work); + ida_simple_remove(&subsys->cntlid_ida, ctrl->cntlid); nvmet_subsys_put(subsys); |