Skip to content

Commit 3f6e324

Browse files
mwilckChristoph Hellwig
authored andcommitted
nvme-multipath: fix logic for non-optimized paths
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 <[email protected]> Signed-off-by: Hannes Reinecke <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 9f98772 commit 3f6e324

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/nvme/host/multipath.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,12 @@ static struct nvme_ns *nvme_round_robin_path(struct nvme_ns_head *head,
255255
fallback = ns;
256256
}
257257

258+
/* No optimized path found, re-check the current path */
259+
if (!nvme_path_is_disabled(old) &&
260+
old->ana_state == NVME_ANA_OPTIMIZED) {
261+
found = old;
262+
goto out;
263+
}
258264
if (!fallback)
259265
return NULL;
260266
found = fallback;

0 commit comments

Comments
 (0)