[PATCH] nvmet: Fix error handling in nvmet_execute_identify_cns_cs_ns()

Keith Busch kbusch at kernel.org
Tue Mar 14 11:41:03 PDT 2023


On Tue, Mar 14, 2023 at 03:20:36PM +0900, Damien Le Moal wrote:
> 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: aaf2e048af27 ("nvmet: add ZBD over ZNS backend support")
> Signed-off-by: Damien Le Moal <damien.lemoal at opensource.wdc.com>

Looks good.

Reviewed-by: Keith Busch <kbusch at kernel.org>



More information about the Linux-nvme mailing list