[PATCH v2 0/2] nvmet: fix FID 82h status codes for invalid NSIDs

Keith Busch kbusch at kernel.org
Sat Oct 3 01:54:38 PDT 2026


On Sun, Sep 20, 2026 at 11:34:58AM +0800, Guixin Liu wrote:
> The Reservation Notification Mask feature (FID 82h) defines its own
> status code for NSIDs that do not name a namespace supporting
> reservations:
> 
>   "A Get Features command that uses a namespace ID of FFFFFFFFh
>   shall be aborted with status code of Invalid Field in Command. [...]
>   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
> 
> nvmet routes the namespace lookup of both handlers 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, a Get Features 82h naming a
> nonexistent NSID, and a Get Features 82h using the broadcast NSID are
> all aborted with Invalid Namespace or Format instead of Invalid Field
> in Command.
> 
> Each patch fixes one handler and translates the lookup failure to
> Invalid Field in Command.  The Set Features broadcast, the
> namespace-without-reservations case, the disabled namespace path
> (Internal Path Error, commit 505363957fad ("nvmet: fix nvme status
> code when namespace is disabled")) and everything else keep their
> current behavior.

Thanks, applied to nvme-7.3.



More information about the Linux-nvme mailing list