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

From: jianchao.wang
Date: Sun Feb 11 2018 - 20:42:30 EST


Hi Sagi

Thanks for your kindly response and directive.
That's really appreciated.

On 02/11/2018 07:16 PM, Sagi Grimberg wrote:
>> ÂÂÂÂÂ 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?

Yes, I will use this interface next version, as well as the 1st patch.

Sincerely
Jianchao

>
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme@xxxxxxxxxxxxxxxxxxx
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.infradead.org_mailman_listinfo_linux-2Dnvme&d=DwICAg&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=7WdAxUBeiTUTCy8v-7zXyr4qk7sx26ATvfo6QSTvZyQ&m=w-s8SrsXdziNNWDrav4KevPTjbt0WNbNQsEmXKL--FY&s=o0wVdE60HzA9inklf3xGMxQjy6l6JHNoDICmOHDBZMA&e=
>