diff options
author | Damien Le Moal <damien.lemoal@opensource.wdc.com> | 2023-03-15 11:59:38 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2023-04-13 08:55:04 +0200 |
commit | a5a6ab0950b46ab1ef4a5c83c80234018b81b38a (patch) | |
tree | bfaa57a076597d4573883b2a33919972e9296869 /drivers/nvme/target/zns.c | |
parent | nvmet: fix Identify Active Namespace ID list handling (diff) | |
download | linux-a5a6ab0950b46ab1ef4a5c83c80234018b81b38a.tar.xz linux-a5a6ab0950b46ab1ef4a5c83c80234018b81b38a.zip |
nvmet: fix I/O Command Set specific Identify Controller
For an identify command with cns set to NVME_ID_CNS_CS_CTRL, the NVMe
2.0 specification states that:
If the I/O Command Set specified by the CSI field does not have an
Identify Controller data structure, then the controller shall return
a zero filled data structure. If the host requests a data structure for
an I/O Command Set that the controller does not support, the controller
shall abort the command with a status code of Invalid Field in Command.
However, the current implementation of this identify command in
nvmet_execute_identify() only handles the ZNS command set, returning an
error for the NVM command set, which is not compliant with the
specifications as we do support this command set.
Fix this by:
1) Renaming nvmet_execute_identify_cns_cs_ctrl() to
nvmet_execute_identify_ctrl_zns() to continue handling the
ZNS command set as is.
2) Introduce a nvmet_execute_identify_ctrl_ns() helper to handle the
NVM command set, returning a zero filled nvme_id_ctrl_nvm data
structure.
3) Modify nvmet_execute_identify() to call these helpers based on
the csi specified, returning an error for unsupported command sets.
Fixes: aaf2e048af27 ("nvmet: add ZBD over ZNS backend support")
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Tested-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/target/zns.c')
-rw-r--r-- | drivers/nvme/target/zns.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c index 77ef0a86ff61..ae4d9d35e46a 100644 --- a/drivers/nvme/target/zns.c +++ b/drivers/nvme/target/zns.c @@ -70,7 +70,7 @@ bool nvmet_bdev_zns_enable(struct nvmet_ns *ns) return true; } -void nvmet_execute_identify_cns_cs_ctrl(struct nvmet_req *req) +void nvmet_execute_identify_ctrl_zns(struct nvmet_req *req) { u8 zasl = req->sq->ctrl->subsys->zasl; struct nvmet_ctrl *ctrl = req->sq->ctrl; |