[PATCH] Revert "nvme: verify MNAN value if ANA is enabled"

Daniel Wagner dwagner at suse.de
Thu Jun 10 04:51:26 PDT 2021


On Thu, Jun 10, 2021 at 09:45:46AM +0200, Daniel Wagner wrote:
> >         id->nn = cpu_to_le32(ctrl->subsys->max_nsid);
> > -       id->mnan = cpu_to_le32(NVMET_MAX_NAMESPACES);
> > +       id->mnan = cpu_to_le32(ctrl->subsys->max_nsid);
> >         id->oncs = cpu_to_le16(NVME_CTRL_ONCS_DSM |
> >                         NVME_CTRL_ONCS_WRITE_ZEROES);
> 

I am a bit confused how the target code indexes the namespaces. In 6.1
Namespaces the valid range for NSID is defined from 0 to namespace
-1. In 6.1.2 it says 'Any NSID is valid, except if that NSID is 0h or
greater than the Number of Namespaces'. And the figure 348 shows clearly
NSID 0 is not valid.

Looking through the code I think the nsid range used starts at 0 and not
at 1. Which would explain why the above change is not enough. The valid
range for max_nsid should start at 1 and not 0.

Thoughts?



More information about the Linux-nvme mailing list