[PATCH] nvme: retrigger ANA log update if group descriptor isn't found

Keith Busch kbusch at kernel.org
Thu Mar 25 21:54:27 GMT 2021


On Thu, Mar 25, 2021 at 10:55:51AM +0000, George, Martin wrote:
> On Wed, 2021-01-13 at 19:13 -0800, Sagi Grimberg wrote:
> > 
> > > If ANA is enabled but no ANA group descriptor is found when
> > > creating
> > > a new namespace the ANA log is most likely out of date, so trigger
> > > a re-read. The namespace will be tagged with the NS_ANA_PENDING
> > > flag
> > > to exclude it from path selection until the ANA log has been re-
> > > read.
> > > 
> > > Reported-by: Martin George <marting at netapp.com>
> > > Signed-off-by: Hannes Reinecke <hare at suse.de>
> > > ---
> > >   drivers/nvme/host/multipath.c | 4 ++++
> > >   1 file changed, 4 insertions(+)
> > > 
> > > diff --git a/drivers/nvme/host/multipath.c
> > > b/drivers/nvme/host/multipath.c
> > > index 74896be40c17..ee4a42dc99a0 100644
> > > --- a/drivers/nvme/host/multipath.c
> > > +++ b/drivers/nvme/host/multipath.c
> > > @@ -667,6 +667,10 @@ void nvme_mpath_add_disk(struct nvme_ns *ns,
> > > struct nvme_id_ns *id)
> > >               if (desc.state) {
> > >                       /* found the group desc: update */
> > >                       nvme_update_ns_ana_state(&desc, ns);
> > > +             } else {
> > > +                     /* group desc not found: trigger a re-read */
> > > +                     set_bit(NVME_NS_ANA_PENDING, &ns->flags);
> > > +                     queue_work(nvme_wq, &ns->ctrl->ana_work);
> > 
> > btw, I just commented on the original thread, but I do like this
> > one better.
> > 
> > Reviewed-by: Sagi Grimberg <sagi at grimberg.me>
> > 
> 
> We now have a ratified ECN which clarifies that a NVME_AEN_CFG_NS_ATTR
> is sufficient for announcing a new namespace along with a new ANA
> group, as opposed to additionally raising a NVME_AEN_CFG_ANA_CHANGE as
> well for the latter - available at 
> https://nvmexpress.org/wp-content/uploads/NVM-Express-1.4-Ratified-ECN.zip
> . I hope that finally clears the confusion on this topic.
> 
> So could we now have this patch pulled in please?

Yeah, I was fine with the patch initiailly since it is harmless and
provides higher tolerance to unclear behavior. The ECN essentially
requires this patch now, so again:

Reviewed-by: Keith Busch <kbusch at kernel.org>



More information about the Linux-nvme mailing list