Re: [PATCH] nvme: fix swapped ZRASF zone state values for full and read only

From: Damien Le Moal

Date: Wed Sep 30 2026 - 03:39:11 EST


On 2026/09/29 16:25, Andreas Hindborg wrote:
> From: Karl Bonde Torp <k.torp@xxxxxxxxxxx>
>
> The Zone Management Receive command Zone Receive Action Specific (ZRASF)
> reporting option values for the Full and Read Only zone states are swapped
> compared to the NVM Express Zoned Namespace Command Set Specification,
> Revision 1.5, Figure 35:

Not only rev 1.5. The same definitions are in all ZNS spec versions.

>
> - 5h lists the zones in the ZSF:Full state.
> - 6h lists the zones in the ZSRO:Read Only state.
>
> The nvmet ZNS backend uses these constants to map the ZRASF value received
> from the host to a block layer zone condition when filtering zones in
> Report Zones. Because of the swap, a host asking for full zones was given
> the read only zones, and a host asking for read only zones was given the
> full zones.
>
> Swap the values of NVME_ZRASF_ZONE_STATE_FULL and
> NVME_ZRASF_ZONE_STATE_READONLY to match the specification.
>
> Fixes: aaf2e048af27 ("nvmet: add ZBD over ZNS backend support")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Karl Bonde Torp <k.torp@xxxxxxxxxxx>

Reviewed-by: Damien Le Moal <dlemoal@xxxxxxxxxx>

--
Damien Le Moal
Western Digital Research