[PATCH 2/2] nvme: fix atomic write boundary validation

John Garry john.g.garry at oracle.com
Mon Jun 16 03:19:44 PDT 2025


On 11/06/2025 06:54, Christoph Hellwig wrote:
>   		ret = nvme_init_effects(ctrl, id);
>   		if (ret)
>   			goto out_free;
> +
> +		ctrl->subsys->awupf = le16_to_cpu(id->awupf);
>   	}
> +
> +	if (le16_to_cpu(id->awupf) != ctrl->subsys->awupf) {
> +		dev_err_ratelimited(ctrl->device,
> +			"inconsistent AWUPF, controller not added (%u/%u).\n",
> +			le16_to_cpu(id->awupf), ctrl->subsys->awupf);

Could we just disable atomic writes instead of doing this?

Or are there bigger issues, like the value returned from 
nvme_update_disk_info() for setting the physical block size is just not 
valid?


> +		ret = -EINVAL;
> +		goto out_free;
> +	}
> +
>   	memcpy(ctrl->subsys->firmware_rev, id->fr,
>   	       sizeof(ctrl->subsys->firmware_rev));




More information about the Linux-nvme mailing list