[PATCH RFC 1/4] block: Make bdev_can_atomic_write() robust against mis-aligned bdev size

Christoph Hellwig hch at lst.de
Thu Sep 12 06:15:06 PDT 2024


On Tue, Sep 03, 2024 at 03:07:45PM +0000, John Garry wrote:
> For bdev file operations, a write will be truncated when trying to write
> past the end of the device. This could not be tolerated for an atomic
> write.
> 
> Ensure that the size of the bdev matches max atomic write unit so that this
> truncation would never occur.

But we'd still support atomic writes for all but the last sectors of
the device?  Isn't this really an application problem?

If not supporting atomic writes at all for unaligned devices is the right
thing to do, we'll need to clearly document this somewhere.  Any maybe
also add a pr_once to log a message?




More information about the Linux-nvme mailing list