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

Sagi Grimberg sagi at grimberg.me
Tue Jun 13 06:16:07 PDT 2023


> When error recovery is interrupted by controller removal, the controller
> is left as quiesced, then IO hang can be caused.
> 
> Fix the issue by unquiescing controller unconditionally when removing
> namespaces.
> 
> Reported-by: Chunguang Xu <brookxu.cn at gmail.com>
> Closes: https://lore.kernel.org/linux-nvme/cover.1685350577.git.chunguang.xu@shopee.com/
> Signed-off-by: Ming Lei <ming.lei at redhat.com>
> ---
>   drivers/nvme/host/core.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 3ec38e2b9173..4ef5eaecaa75 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -4692,6 +4692,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);
> +

Looks fine, but I think that the removal of the unquiesce from
the condition below (CTRL_DEAD) should be done in this patch.

>   	/* prevent racing with ns scanning */
>   	flush_work(&ctrl->scan_work);
>   



More information about the Linux-nvme mailing list