nvme-multipath: relax ANA state check
PATCH 1/1 nvme-multipath: relax ANA state check
From: Martin George <[email protected]>
Always call nvme_mpath_set_live() when transitioning to a live state, where live is defined as ANA Optimized or Non-Optimized, irrespective of what the previous asymmetric access state was. This removes the restriction of only permitting transitions from states that were not considered live.
--- drivers/nvme/host/multipath.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/nvme/host/multipath.c +1 -4
@@ -366,15 +366,12 @@ static inline bool nvme_state_is_live(enum nvme_ana_state state)static void nvme_update_ns_ana_state (struct nvme_ana_group_desc *desc,struct nvme_ns *ns) { -enum nvme_ana_state old; -mutex_lock (&ns->head->lock); - old = ns->ana_state; ns->ana_grpid =le32_to_cpu (desc->grpid); ns->ana_state = desc->state;clear_bit (NVME_NS_ANA_PENDING , &ns->flags); -if (nvme_state_is_live (ns->ana_state) && !nvme_state_is_live (old)) +if (nvme_state_is_live (ns->ana_state))nvme_mpath_set_live (ns);mutex_unlock (&ns->head->lock); }
Signature · 1 line
2.17.1
Christoph Hellwig
maintainerPATCH 1/1 nvme-multipath: relax ANA state check
Quoted 7 lines · On Mon, Jan 28, 2019@07:54:46PM +0530, [email protected] wrote:
From: Martin George <marting at netapp.com>
Always call
nvme_mpath_set_live()when transitioning to a live state, where live is defined as ANA Optimized or Non-Optimized, irrespective of what the previous asymmetric access state was. This removes the restriction of only permitting transitions from states that were not considered live.
This still doesn't make sense. We never prohibit a transition here.
What kind of problem do you see that triggered this patch?
PATCH 1/1 nvme-multipath: relax ANA state check
Quoted 11 lines · Christoph Hellwig
Quoted 7 lines · martinus.gpy at gmail.com
From: Martin George <marting at netapp.com>
Always call
nvme_mpath_set_live()when transitioning to a live state, where live is defined as ANA Optimized or Non-Optimized, irrespective of what the previous asymmetric access state was. This removes the restriction of only permitting transitions from states that were not considered live.
Quoted 3 lines
This still doesn't make sense. We never prohibit a transition here.
What kind of problem do you see that triggered this patch?
We saw I/O successfully resume on a namespace that transitioned from Inaccessible to Optimized on the ANA host. No issues there. But at the same time, I/O hung when it transitioned from Optimized to Optimized itself.
After applying the above patch, this problem was resolved and I/O successfully resumed for this same state Optimized to Optimized transition scenario. In fact with the above patch, it should also permit I/O to successfully resume for Optimized to Non-Optimized scenarios (& vice versa) as well, all of which are valid transition scenarios as per the NVMe 1.3 TP4004 ANA spec.
-Martin George
[email protected]
maintainerPATCH 1/1 nvme-multipath: relax ANA state check
Quoted 12 lines · Martin
Quoted 11 lines · Christoph Hellwig
Quoted 7 lines · martinus.gpy at gmail.com
From: Martin George <marting at netapp.com>
Always call
nvme_mpath_set_live()when transitioning to a live state, where live is defined as ANA Optimized or Non-Optimized, irrespective of what the previous asymmetric access state was. This removes the restriction of only permitting transitions from states that were not considered live.
Quoted 8 lines
Quoted 3 lines
This still doesn't make sense. We never prohibit a transition here.
What kind of problem do you see that triggered this patch?
We saw I/O successfully resume on a namespace that transitioned from Inaccessible to Optimized on the ANA host. No issues there. But at the same time, I/O hung when it transitioned from Optimized to Optimized itself.
Well, I/O should haver never stopped in that case. Can you please try to help debugging why it even stopped?
Quoted 7 lines
After applying the above patch, this problem was resolved and I/O successfully resumed for this same state Optimized to Optimized transition scenario. In fact with the above patch, it should also permit I/O to successfully resume for Optimized to Non-Optimized scenarios (& vice versa) as well, all of which are valid transition scenarios as per the NVMe 1.3 TP4004 ANA spec.
Again, there is nothing in the code that prohibits transitions, so this explanation doesn't make sense. It it obvious that you saw a problem and that we have an issue somewhere. But the patch description is plain wrong, and I suspect that the problem might be elsewhere as well.