Re: [PATCH 2/9] nvme: fix the deadlock in nvme_update_formats

From: Sagi Grimberg
Date: Sun Feb 11 2018 - 06:16:10 EST


mutex_lock(&ctrl->namespaces_mutex);
list_for_each_entry(ns, &ctrl->namespaces, list) {
- if (ns->disk && nvme_revalidate_disk(ns->disk))
- nvme_ns_remove(ns);
+ if (ns->disk && nvme_revalidate_disk(ns->disk)) {
+ list_del_init(&ns->list);
+ list_add_tail(&ns->list, &rm_list);

list_move_tail?