[PATCH] nvme/pci: fix queue_rqs list splitting

Christoph Hellwig hch at lst.de
Wed Dec 22 22:20:47 PST 2021


On Wed, Dec 22, 2021 at 01:41:59PM -0800, Keith Busch wrote:
>  			/* detach 'req' and add to remainder list */
> +			struct request *next = rq_list_next(req);
> +
>  			if (prev)
> -				prev->rq_next = req->rq_next;
> +				prev->rq_next = next;
> +			else
> +				*rqlist = next;
> +
>  			rq_list_add(&requeue_list, req);
> -		} else {
> +
> +			if (prev)
> +				req = prev;
> +			else
> +				req = next;
> +		}
> +
> +		if (req) {
>  			prev = req;
> +			req = rq_list_next(req);
>  		}

This hunk absolutely needs to go into a helper instead of being open
coded in a driver.



More information about the Linux-nvme mailing list