[PATCH 1/5] nvme: zns: reject an out-of-range zone append size limit

Christoph Hellwig hch at lst.de
Fri Nov 20 09:49:14 PST 2026


On Sun, Nov 15, 2026 at 01:27:52AM +0800, shao.mingyin at zte.com.cn wrote:
> 
> diff --git a/drivers/nvme/host/zns.c b/drivers/nvme/host/zns.c
> index e31ec6f4f94f..c34015e68f81 100644
> --- a/drivers/nvme/host/zns.c
> +++ b/drivers/nvme/host/zns.c
> @@ -27,10 +27,15 @@ static int nvme_set_max_append(struct nvme_ctrl *ctrl)
>  		return status;
>  	}
>  
> -	if (id->zasl)
> -		ctrl->max_zone_append = 1 << (id->zasl + 3);
> -	else
> +	if (id->zasl && id->zasl + 3 < 32) {
> +		ctrl->max_zone_append = 1U << (id->zasl + 3);
> +	} else {
> +		if (id->zasl)
> +			dev_warn(ctrl->device,
> +				 "invalid zone append size limit %u\n",
> +				 id->zasl);

This warning triggers for perfectly valid values that we just can't
express.  I think we can just drop it.




More information about the Linux-nvme mailing list