[PATCH 1/6] nvme-mpath: No need to protect req->bio with requeue_lock

John Garry john.g.garry at oracle.com
Mon Aug 24 08:53:10 PDT 2026


> ---
>    drivers/nvme/host/multipath.c | 3 ++-
>    1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
> index 9b9a657fa330..b5501217303c 100644
> --- a/drivers/nvme/host/multipath.c
> +++ b/drivers/nvme/host/multipath.c
> @@ -164,9 +164,10 @@ void nvme_failover_req(struct request *req)
>    		queue_work(nvme_wq, &ns->ctrl->ana_work);
>    	}
>    
> -	spin_lock_irqsave(&ns->head->requeue_lock, flags);
>    	for (bio = req->bio; bio; bio = bio->bi_next)
>    		bio_set_dev(bio, ns->head->disk->part0);
> +
> +	spin_lock_irqsave(&ns->head->requeue_lock, flags);
>    	blk_steal_bios(&ns->head->requeue_list, req);

I think that the first half of blk_steal_bios() doesn't not require the 
lock either and does the same bio loop as for calling bio_set_dev(), 
above. Maybe another helper could be added for all of that.

But this still looks ok, so:

Reviewed-by: John Garry <john.g.garry at oracle.com>

>    	spin_unlock_irqrestore(&ns->head->requeue_lock, flags);
>    
> -- 
> 2.43.0
> 
> 




More information about the Linux-nvme mailing list