Messages in this thread | | | Subject | Re: [PATCH 2/2] nvme-core: Fix deadlock when deleting the ctrl while scanning | From | Sagi Grimberg <> | Date | Fri, 19 Jul 2019 13:15:50 -0700 |
| |
>> [1]: > Or actually: > -- > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c > index 76cd3dd8736a..a0e2072fe73e 100644 > --- a/drivers/nvme/host/core.c > +++ b/drivers/nvme/host/core.c > @@ -3576,6 +3576,12 @@ void nvme_remove_namespaces(struct nvme_ctrl *ctrl) > struct nvme_ns *ns, *next; > LIST_HEAD(ns_list); > > + mutex_lock(&ctrl->scan_lock); > + list_for_each_entry(ns, &ctrl->namespaces, list) > + if (nvme_mpath_clear_current_path(ns)) > + kblockd_schedule_work(&ns->head->requeue_work); > + mutex_lock(&ctrl->scan_lock);
This should be mutex_unlock of course...
| |