Skip to content

Commit

Permalink
nvme-multipath: fix logic for non-optimized paths
Browse files Browse the repository at this point in the history
[ Upstream commit 3f6e324 ]

Handle the special case where we have exactly one optimized path,
which we should keep using in this case.

Fixes: 75c10e7 ("nvme-multipath: round-robin I/O policy")
Signed off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
mwilck authored and gregkh committed Aug 19, 2020
1 parent 4e8691b commit f0a8c02
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/nvme/host/multipath.c
Expand Up @@ -249,6 +249,12 @@ static struct nvme_ns *nvme_round_robin_path(struct nvme_ns_head *head,
fallback = ns;
}

/* No optimized path found, re-check the current path */
if (!nvme_path_is_disabled(old) &&
old->ana_state == NVME_ANA_OPTIMIZED) {
found = old;
goto out;
}
if (!fallback)
return NULL;
found = fallback;
Expand Down

0 comments on commit f0a8c02

Please sign in to comment.