]> Git Repo - J-linux.git/commitdiff
nvmet: use NVMET_MAX_NAMESPACES to set nn value
authorChaitanya Kulkarni <[email protected]>
Mon, 21 Jun 2021 03:01:09 +0000 (20:01 -0700)
committerChristoph Hellwig <[email protected]>
Mon, 21 Jun 2021 06:34:10 +0000 (08:34 +0200)
For Spec regarding MNAN value:-

If the controller supports Asymmetric Namespace Access Reporting, then
this field shall be set to a non-zero value that is less than or equal
to the NN value.

Instead of using subsys->max_nsid that gets calculated dynamically,
use NVMET_MAX_NAMESPACES value to report NN. This way we will maintain
the MNAN value spec compliant with NN.

Without this patch, code results in the following error :-

[337976.409142] nvme nvme1: Invalid MNAN value 1024

Signed-off-by: Chaitanya Kulkarni <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
drivers/nvme/target/admin-cmd.c

index 363e357d2f20bcfc990c5285255ee519acd0d12f..0cb98f2bbc8c7842f323deefc4a6dc23b0218a0a 100644 (file)
@@ -422,7 +422,7 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req)
        /* no enforcement soft-limit for maxcmd - pick arbitrary high value */
        id->maxcmd = cpu_to_le16(NVMET_MAX_CMD);
 
-       id->nn = cpu_to_le32(ctrl->subsys->max_nsid);
+       id->nn = cpu_to_le32(NVMET_MAX_NAMESPACES);
        id->mnan = cpu_to_le32(NVMET_MAX_NAMESPACES);
        id->oncs = cpu_to_le16(NVME_CTRL_ONCS_DSM |
                        NVME_CTRL_ONCS_WRITE_ZEROES);
This page took 0.054594 seconds and 4 git commands to generate.