All of lore.kernel.org
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH] nvme-multipath: relax ANA state check
Date: Mon, 28 Jan 2019 08:43:32 +0100	[thread overview]
Message-ID: <20190128074332.GC3287@lst.de> (raw)
In-Reply-To: <20190125111236.5389-1-marting@netapp.com>

On Fri, Jan 25, 2019@04:42:36PM +0530, martinus.gpy@gmail.com wrote:
> From: Martin George <marting at netapp.com>
> 
> The current nvme multipath code prevents access to a namespace
> through a controller that has transitioned from ANA Optimized
> to Non-Optimized and vice versa.

Note: controllers do not have ANA states, ANA groups and thus
namespaces have states.

> As per the NVMe 1.3 TP4004
> spec, "The change from one asymmetric namespace access state
> to another asymmetric namespace access state is called a
> transition". The emphasis here is on the change itself,
> whatever the change may be. So a change from ANA Optimized to
> Non-Optimized and vice versa, are actually valid transition
> scenarios. In fact, if one were to exit and reenter the same
> state, that too is a change i.e. a change to the same state
> is also a valid transition scenario.
> 
> So remove the "old" state check during ANA state update, so
> that transition from ANA Optimized to Non-Optimized and vice
> versa, along with transition to the same state, are all
> permitted.

This description does not seem to match the patch:

>  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);

What the patch does is to always call nvme_mpath_set_live when
transitioning to a live state, where live is defined as optimized or
non-optimized, instead of limiting that call to transitions from
states that were not considered live.

  parent reply	other threads:[~2019-01-28  7:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-25 11:12 [PATCH] nvme-multipath: relax ANA state check martinus.gpy
2019-01-25 12:57 ` Hannes Reinecke
2019-01-28  7:43 ` Christoph Hellwig [this message]
2019-01-28 14:01   ` George, Martin
  -- strict thread matches above, loose matches on Subject: below --
2019-01-28 14:24 martinus.gpy
2019-01-28 16:30 ` Christoph Hellwig
2019-01-28 17:10   ` George, Martin
2019-01-31 10:03     ` hch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190128074332.GC3287@lst.de \
    --to=hch@lst.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.