diff options
author | Martin Wilck <mwilck@suse.com> | 2020-07-27 19:08:02 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2020-07-29 08:45:22 +0300 |
commit | 3f6e3246db0e6f92e784965d9d0edb8abe6c6b74 (patch) | |
tree | f15f2b73220a0df515110771ce95a6425f52a9ac /drivers/nvme/host/multipath.c | |
parent | 9f98772ba307dd89a3d17dc2589f213d3972fc64 (diff) | |
download | linux-3f6e3246db0e6f92e784965d9d0edb8abe6c6b74.tar.xz |
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: 75c10e732724 ("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>
Diffstat (limited to 'drivers/nvme/host/multipath.c')
-rw-r--r-- | drivers/nvme/host/multipath.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index 900b35d47ec7..93c70e1591de 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -255,6 +255,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; |