[PATCH 2/2] nvme: fix atomic write boundary validation
Christoph Hellwig
hch at lst.de
Mon Jun 16 04:37:55 PDT 2025
On Mon, Jun 16, 2025 at 11:19:44AM +0100, John Garry wrote:
> 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?
This brings up back to the old problem of how do we tell the file system
and/or application that the atomic write size it probed suddenly went
away entirely because a new controller disappeared.
More information about the Linux-nvme
mailing list