[PATCH 1/6] nvme: unquiesce io queues when removing namespaces

Sagi Grimberg sagi at grimberg.me
Tue Jul 11 02:12:20 PDT 2023


>>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>>> index 47d7ba2827ff..98fa8315bc65 100644
>>> --- a/drivers/nvme/host/core.c
>>> +++ b/drivers/nvme/host/core.c
>>> @@ -3903,6 +3903,12 @@ void nvme_remove_namespaces(struct nvme_ctrl *ctrl)
>>>   	 */
>>>   	nvme_mpath_clear_ctrl_paths(ctrl);
>>>   
>>> +	/*
>>> +	 * Unquiesce io queues so any pending IO won't hang, especially
>>> +	 * those submitted from scan work
>>> +	 */
>>> +	nvme_unquiesce_io_queues(ctrl);
>>
>> What quiesce does this pair with?
> 
> The one done during teardown of error recovery, then removal comes and breaks
> the in-progress error recovery.

unquiesce is also safe because of NVME_CTRL_STOPPED flag. All the
drivers depend on it being this way as we unquiesce unconditionally
after reset/(re)connect.

We don't track enough state here to know if the io queues were quiesced
before or not (in the happy delete they weren't and in the unhappy
delete they were).



More information about the Linux-nvme mailing list