linux/drivers/nvme/target
Damien Le Moal ab76e7206b nvmet: fix error handling in nvmet_execute_identify_cns_cs_ns()
Nvme specifications state that:

If the I/O Command Set associated with the namespace identified by the
NSID field does not support the Identify Namespace data structure
specified by the CSI field, the controller shall abort the command with
a status code of Invalid Field in Command.

In other words, if nvmet_execute_identify_cns_cs_ns() is called for a
target with a block device that is not zoned, we should not return any
data and set the status to NVME_SC_INVALID_FIELD.

While at it, it is also better to revalidate the ns block devie *before*
checking if the block device is zoned, to ensure that
nvmet_execute_identify_cns_cs_ns() operates against updated device
characteristics.

Fixes: aaf2e048af ("nvmet: add ZBD over ZNS backend support")
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2023-04-13 08:55:03 +02:00
..
admin-cmd.c nvmet: for nvme admin set_features cmd, call nvmet_check_data_len_lte() 2023-02-01 14:22:00 +01:00
auth.c nvmet: fix a memory leak in nvmet_auth_set_key 2022-11-16 08:36:37 +01:00
configfs.c for-6.2/block-2022-12-08 2022-12-13 10:43:59 -08:00
core.c nvmet: expose firmware revision to configfs 2022-11-21 08:35:58 +01:00
discovery.c nvme: move from strlcpy with unused retval to strscpy 2022-09-19 11:33:53 +02:00
fabrics-cmd-auth.c nvmet-auth: don't try to cancel a non-initialized work_struct 2022-09-27 09:22:09 +02:00
fabrics-cmd.c nvmet: add helpers to set the result field for connect commands 2022-09-27 09:22:09 +02:00
fc.c nvme-fc: fix a missing queue put in nvmet_fc_ls_create_association 2023-02-01 14:18:46 +01:00
fcloop.c nvmet: use a private workqueue instead of the system workqueue 2022-03-29 09:29:04 +02:00
io-cmd-bdev.c nvmet: don't look at the request_queue in nvmet_bdev_set_limits 2022-09-27 18:51:50 +02:00
io-cmd-file.c nvmet: use bvec_set_page to initialize bvecs 2023-02-03 08:20:55 -07:00
Kconfig nvmet-auth: select the intended CRYPTO_DH_RFC7919_GROUPS 2022-08-02 17:22:51 -06:00
loop.c nvme: consolidate setting the tagset flags 2022-12-07 15:02:20 +01:00
Makefile nvmet: implement basic In-Band Authentication 2022-08-02 17:14:49 -06:00
nvmet.h nvmet: expose firmware revision to configfs 2022-11-21 08:35:58 +01:00
passthru.c nvme: remove nvme_execute_passthru_rq 2023-02-01 14:21:59 +01:00
rdma.c RDMA/core: introduce ib_dma_pci_p2p_dma_supported() 2022-07-26 07:28:07 -04:00
tcp.c Networking changes for 6.3. 2023-02-21 18:24:12 -08:00
trace.c nvmet: add set feature tracing support 2021-08-16 14:42:23 +02:00
trace.h nvmet: use min of device_path and disk len 2021-02-10 16:38:05 +01:00
zns.c nvmet: fix error handling in nvmet_execute_identify_cns_cs_ns() 2023-04-13 08:55:03 +02:00