nvmet: cancel fatal error and flush async work before free controller

Make sure they are not running and we can free the controller
safely.

Signed-off-by: Roy Shterman <[email protected]>
Signed-off-by: Sagi Grimberg <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
This commit is contained in:
Sagi Grimberg
2017-01-26 17:45:00 +02:00
parent 344770b07b
commit 06406d81a2
+3
View File
@@ -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);