[PATCH 5/8] nvme: sync the namespace scanning during ctrl start

Sagi Grimberg sagi at grimberg.me
Wed Jan 24 05:54:11 PST 2024


>>>>> @@ -4537,9 +4536,10 @@ void nvme_start_ctrl(struct nvme_ctrl *ctrl)
>>>>>           nvme_change_uevent(ctrl, "NVME_EVENT=rediscover");
>>>>>       if (ctrl->queue_count > 1) {
>>>>> -        nvme_queue_scan(ctrl);
>>>>> +        nvme_queue_scan_sync(ctrl);
>>>>>           nvme_unquiesce_io_queues(ctrl);
>>>>>           nvme_mpath_update(ctrl);
>>>>> +        nvme_kick_requeue_lists(ctrl);
>>>>>       }
>>>>
>>>> I really don't think its a good idea to block ctrl start
>>>> like that.
>>>
>>> like how ? scan_sync ?
>>
>> Yes
> 
> why not ? this is control path..

Because in the real world, namespaces (or HCAs) will not change their
attributes in 99.999999% of the cases, and when they do, in 99.999999%
of the cases the inflight IO has already failed over to a different
path.

So no, I don't think that preventing the ctrl start from making forward
progress until a full namespaces scan completes makes any sense.

> we have to make sure we issue commands to a validated namespace.

I think we should simply refuse to create the ns when it differs between
paths, or remove it in the highly unlikely case where it suddenly
changes its attributes when reconnecting.



More information about the Linux-nvme mailing list