[PATCH] nvme-core: update NS Attr Changed AEN handling for ANA group

George, Martin Martin.George at netapp.com
Wed Nov 18 15:09:43 EST 2020


On Wed, 2020-11-18 at 17:24 +0100, Christoph Hellwig wrote:
> On Wed, Nov 18, 2020 at 05:18:59PM +0530, Martin George wrote:
> > From: Martin George <marting at netapp.com>
> > 
> > The current nvme rescan triggered in response to a NS Attr Changed
> > AEN, fails to add a namespace if belonging to a new ANA group. This
> > is because ana_log_buf->ngrps is not updated in
> > nvme_parse_ana_log(),
> > due to which it is unable to locate the new ANA group's descriptor,
> > eventually resulting in the failure to add the namespace during the
> > rescan. Fix this by reading the ANA log page as part of ana_work so
> > that ngrps gets updated, prior to invoking nvme_queue_scan().
> 
> How can the namespace reference an ANA group that we haven't been
> notified about using the NVME_AEN_CFG_ANA_CHANGE AEN before?

Well, I think that could be possible for a newly created namespace,
which happens to belong to a new ANA group. To quote the 1.4 spec in
context of Asymmetric Namespace Access Change under the Asynchronous
Event Information - Notice (Figure 147):

"A controller shall not send this event if:
a) the change is due to the creation of a namespace (refer to section
5.20); or
b) the change is due to the deletion of a namespace (refer to section
5.20),
as the Namespace Attribute Changed event is sent for these changes."

So it looks the NVME_AEN_CFG_ANA_CHANGE AEN is not required here for
such cases, but instead the NVME_AEN_CFG_NS_ATTR AEN would do.

-Martin


More information about the Linux-nvme mailing list