diff options
author | Max Gurtovoy <mgurtovoy@nvidia.com> | 2021-02-17 18:19:40 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2021-03-05 13:41:03 +0100 |
commit | d9f273b7585c380d7a10d4b3187ddc2d37f2740b (patch) | |
tree | 998d7f00c98c8e32455368f243f5ccef5ab577bf /drivers/nvme/target/nvmet.h | |
parent | nvme-fabrics: fix kato initialization (diff) | |
download | linux-d9f273b7585c380d7a10d4b3187ddc2d37f2740b.tar.xz linux-d9f273b7585c380d7a10d4b3187ddc2d37f2740b.zip |
nvmet: model_number must be immutable once set
In case we have already established connection to nvmf target, it
shouldn't be allowed to change the model_number. E.g. if someone will
identify ctrl and get model_number of "my_model" later on will change
the model_numbel via configfs to "my_new_model" this will break the NVMe
specification for "Get Log Page – Persistent Event Log" that refers to
Model Number as: "This field contains the same value as reported in the
Model Number field of the Identify Controller data structure, bytes
63:24."
Although it doesn't mentioned explicitly that this field can't be
changed, we can assume it.
So allow setting this field only once: using configfs or in the first
identify ctrl operation.
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to '')
-rw-r--r-- | drivers/nvme/target/nvmet.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h index cdfa537b1c0a..4b84edb49f22 100644 --- a/drivers/nvme/target/nvmet.h +++ b/drivers/nvme/target/nvmet.h @@ -208,11 +208,6 @@ struct nvmet_ctrl { bool pi_support; }; -struct nvmet_subsys_model { - struct rcu_head rcuhead; - char number[]; -}; - struct nvmet_subsys { enum nvme_subsys_type type; @@ -242,7 +237,7 @@ struct nvmet_subsys { struct config_group namespaces_group; struct config_group allowed_hosts_group; - struct nvmet_subsys_model __rcu *model; + char *model_number; #ifdef CONFIG_NVME_TARGET_PASSTHRU struct nvme_ctrl *passthru_ctrl; |