Skip to content

Commit 3c3ee16

Browse files
ChaitanayaKulkarniChristoph Hellwig
authored andcommitted
nvmet: use NVMET_MAX_NAMESPACES to set nn value
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]>
1 parent 8cf486e commit 3c3ee16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvme/target/admin-cmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req)
422422
/* no enforcement soft-limit for maxcmd - pick arbitrary high value */
423423
id->maxcmd = cpu_to_le16(NVMET_MAX_CMD);
424424

425-
id->nn = cpu_to_le32(ctrl->subsys->max_nsid);
425+
id->nn = cpu_to_le32(NVMET_MAX_NAMESPACES);
426426
id->mnan = cpu_to_le32(NVMET_MAX_NAMESPACES);
427427
id->oncs = cpu_to_le16(NVME_CTRL_ONCS_DSM |
428428
NVME_CTRL_ONCS_WRITE_ZEROES);

0 commit comments

Comments
 (0)