[PATCH] nvmet: Fix error handling in nvmet_execute_identify_cns_cs_ns()
Damien Le Moal
damien.lemoal at opensource.wdc.com
Tue Mar 14 23:35:37 PDT 2023
On 3/15/23 14:14, Chaitanya Kulkarni wrote:
> On 3/13/2023 11:20 PM, 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>
>> ---
>
> Thanks for fixing that.
More identify fixes coming.
>
> Reviewed-by: Chaitanya Kulkarni <kch at nvidia.com>
Thanks.
>
> -ck
>
>
--
Damien Le Moal
Western Digital Research
More information about the Linux-nvme
mailing list