Skip to content

Commit

Permalink
nvmet: cancel fatal error and flush async work before free controller
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sagi Grimberg committed Jan 26, 2017
1 parent 344770b commit 06406d8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/nvme/target/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 06406d8

Please sign in to comment.