[PATCH 1/2] nvme: respect NVME_QUIRK_DISABLE_WRITE_ZEROES when wzsl is set

Keith Busch kbusch at kernel.org
Tue Mar 24 08:05:46 PDT 2026


On Fri, Mar 20, 2026 at 07:22:08PM +0000, Bob Beckett wrote:
> ---
>  drivers/nvme/host/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 766e9cc4ffca..ce25c8a4e84b 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -3388,7 +3388,7 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)
>  
>  	ctrl->dmrl = id->dmrl;
>  	ctrl->dmrsl = le32_to_cpu(id->dmrsl);
> -	if (id->wzsl)
> +	if (id->wzsl && !(ctrl->quirks & NVME_QUIRK_DISABLE_WRITE_ZEROES))
>  		ctrl->max_zeroes_sectors = nvme_mps_to_sectors(ctrl, id->wzsl);

Interesting. This is from a more recent identification that I would have
hoped devices going through the trouble of implementing it would have
figured out by now how to report write zeroes support correctly.

Patches applied to nvme-7.1, thanks.



More information about the Linux-nvme mailing list