[PATCH v2] nvme: limit Write Zeroes to 65536 logical blocks
Chaitanya Kulkarni
chaitanyak at nvidia.com
Tue Nov 17 11:44:18 PST 2026
On 11/16/26 5:10 PM, Ankit Gupta wrote:
> With nvme-tcp connected to nvmet-tcp at default settings, the target
> reports MDTS 0 and WZSL 0. A 33 MiB Write Zeroes request on a
> 512-byte-LBA namespace then completes successfully after zeroing only
> the first 1 MiB.
>
> The native Write Zeroes command encodes the number of logical blocks
> in a zero-based 16-bit field. The namespace queue can advertise a
> larger limit, either through the MDTS fallback or through WZSL. In
> that case the host truncates the count when building the command and
> reports success after zeroing only part of the requested range.
>
> Cap the native Write Zeroes limit at the number of logical blocks the
> command can encode. Convert that limit to sectors for each namespace
> and retain any smaller controller limit. The DSM deallocation quirk
> continues to use its own limit.
>
> Fixes: b94e8cd2e6a9 ("nvme: fix Write Zeroes limitations")
> Cc:stable at vger.kernel.org
> Signed-off-by: Ankit Gupta<ankit6791 at gmail.com>
Thanks a lot for the fix, looks good to me.
Reviewed-by: Chaitanya Kulkarni <kch at nvidia.com>
-ck
More information about the Linux-nvme
mailing list