[PATCH 2/2] nvme-multipath: do not fall back to __nvme_find_path() for non-optimized paths
Hannes Reinecke
hare at suse.de
Tue Jul 28 02:25:18 EDT 2020
On 7/27/20 9:46 PM, Sagi Grimberg wrote:
>
>
> On 7/27/20 9:08 AM, Hannes Reinecke wrote:
>> When nvme_round_robin_path() finds a valid namespace we should be
>> using it;
>> falling back to __nvme_find_path() for non-optimized paths will cause the
>> result from nvme_round_robin_path() to be ignored for non-optimized
>> paths.
>>
>> Signed-off-by: Martin Wilck <mwilck at suse.com>
>> Signed-off-by: Hannes Reinecke <hare at suse.de>
>> ---
>> drivers/nvme/host/multipath.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/nvme/host/multipath.c
>> b/drivers/nvme/host/multipath.c
>> index fe8f7f123fac..97d3c19b5684 100644
>> --- a/drivers/nvme/host/multipath.c
>> +++ b/drivers/nvme/host/multipath.c
>> @@ -272,8 +272,11 @@ inline struct nvme_ns *nvme_find_path(struct
>> nvme_ns_head *head)
>> struct nvme_ns *ns;
>> ns = srcu_dereference(head->current_path[node], &head->srcu);
>> - if (READ_ONCE(head->subsys->iopolicy) == NVME_IOPOLICY_RR && ns)
>> + if (READ_ONCE(head->subsys->iopolicy) == NVME_IOPOLICY_RR && ns) {
>> ns = nvme_round_robin_path(head, node, ns);
>> + if (ns)
>> + return ns;
>> + }
>> if (unlikely(!ns || !nvme_path_is_optimized(ns)))
>> ns = __nvme_find_path(head, node);
>
> Maybe instead of the early return put the following condition on else?
That depends on whether we want to have a fallback to __nvme_find_path()
or not. With your suggestion we would lose that; I'd rather keep it.
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare at suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer
More information about the Linux-nvme
mailing list