[PATCH 3/3] nvme-multipath: skip failed paths during partition scan
Sagi Grimberg
sagi at grimberg.me
Sun Oct 20 16:38:28 PDT 2024
>> diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
>> index f03ef983a75f..4113d38606a4 100644
>> --- a/drivers/nvme/host/multipath.c
>> +++ b/drivers/nvme/host/multipath.c
>> @@ -102,6 +102,13 @@ void nvme_failover_req(struct request *req)
>> queue_work(nvme_wq, &ns->ctrl->ana_work);
>> }
>>
>> + /*
>> + * Do not use this path during scanning
>> + * to avoid deadlocks in device_add_disk()
>> + */
>> + if (mutex_is_locked(&ns->ctrl->scan_lock))
>> + set_bit(NVME_NS_SCAN_FAILED, &ns->flags);
> Err, no. mutex_is_locked is never a valid way to detect the calling
> context - obviously someone else could also be holding it.
>
Strongly agree here.
More information about the Linux-nvme
mailing list