summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/target/nvmet.h
diff options
context:
space:
mode:
authorNoam Gottlieb <ngottlieb@nvidia.com>2021-03-15 15:56:11 +0100
committerChristoph Hellwig <hch@lst.de>2021-04-02 18:48:27 +0200
commit48b4c010c85bbd319fbcae79b2d602857a2e9345 (patch)
treeae315b9b172357e5665c8184a145a11be6129195 /drivers/nvme/target/nvmet.h
parentnvmet: remove unnecessary ctrl parameter (diff)
downloadlinux-48b4c010c85bbd319fbcae79b2d602857a2e9345.tar.xz
linux-48b4c010c85bbd319fbcae79b2d602857a2e9345.zip
nvmet: do not allow model_number exceed 40 bytes
According to the NVM specifications, the model number size should be 40 bytes (bytes 63:24 of the Identify Controller data structure). Therefore, any attempt to store a value into model_number which exceeds 40 bytes should return an error. Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com> Signed-off-by: Noam Gottlieb <ngottlieb@nvidia.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/target/nvmet.h')
-rw-r--r--drivers/nvme/target/nvmet.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h
index 24e261bf153a..5566ed403576 100644
--- a/drivers/nvme/target/nvmet.h
+++ b/drivers/nvme/target/nvmet.h
@@ -27,6 +27,7 @@
#define NVMET_ERROR_LOG_SLOTS 128
#define NVMET_NO_ERROR_LOC ((u16)-1)
#define NVMET_DEFAULT_CTRL_MODEL "Linux"
+#define NVMET_MN_MAX_SIZE 40
/*
* Supported optional AENs: