[RFC PATCH] nvme-multipath: break endless loop in nvme_round_robin_path

Daniel Wagner dwagner at suse.de
Tue Mar 22 05:07:27 PDT 2022


On Tue, Mar 22, 2022 at 12:17:43PM +0100, Christoph Hellwig wrote:
> On Mon, Mar 21, 2022 at 03:43:03PM -0700, Chris Leech wrote:
> > This is a backstop for the odd loop construct in nvme_round_robin_path.
> > It counts how many times the head pointer has been passed, as that's the
> > only thing guarenteed to stay on the list.  Once is needed to start from
> > a different place and check the entire list, twice is excessive looping.
> 
> Shouldn't

d1bcf006a9d3 ("nvme-multipath: Early exit if no path is available")

> take care of this?

IIRC, this addressed the issue that we started to dereference a NULL
pointer if there was no path left.

Chris' problem is that the iterator always returns the same
pointer. Personally, I prefer the solution to introduce some sort of
sentinel over the one with the locking.



More information about the Linux-nvme mailing list