[PATCH v2 1/2] nvmet: return Invalid Field for invalid NSIDs in Set Features 82h
Nilay Shroff
nilay at linux.ibm.com
Fri Sep 25 04:24:28 PDT 2026
On 9/20/26 9:04 AM, Guixin Liu wrote:
> The Reservation Notification Mask feature (FID 82h) defines its own
> status code for namespaces that do not support reservations:
>
> "If a Set Features command or a Get Features command attempts to
> access the Reservation Notification Mask on a namespace that does
> not support reservations or is invalid, then that command is
> aborted with status code of Invalid Field in Command."
>
> -- NVMe Base Specification, section 5.2.26.1.33
>
> The Set Features handler routes the namespace lookup through
> nvmet_req_find_ns(), which returns Invalid Namespace or Format for an
> unknown NSID. That is the correct status for the generic
> namespace-scoped admin commands, but not for this feature: a Set
> Features 82h naming a nonexistent NSID is aborted with Invalid
> Namespace or Format instead of Invalid Field in Command.
>
> Translate the lookup failure to Invalid Field in Command. The
> broadcast NSID, the namespace-without-reservations case and everything
> else keep their current behavior.
>
> Fixes: 5a47c2080a73 ("nvmet: support reservation feature")
> Signed-off-by: Guixin Liu<kanie at linux.alibaba.com>
Looks good to me.
Reviewed-by: Nilay Shroff <nilay at linux.ibm.com>
More information about the Linux-nvme
mailing list