RE: [RFC PATCH] xfs: add a per-filesystem switch to force atomic CoW

From: Wayne Gao

Date: Tue Nov 24 2026 - 12:19:22 EST


> If so, why do we
> need this at the fs level? If not, why isn't it the hardware atomic
> write behaviour configurable at the bdev level?
>
Wayne, actually bdev level have no control to enable or disable it. And NVMe does not have any atomic field to process it differently. Only XFS honor this flag.

-----Original Message-----
From: John Garry <john.garry@xxxxxxxxx>
Sent: Tuesday, November 24, 2026 4:33 PM
To: Dave Chinner <dgc@xxxxxxxxxx>; Wayne Gao <Wayne.Gao1@xxxxxxxxxxxx>
Cc: cem@xxxxxxxxxx; linux-xfs@xxxxxxxxxxxxxxx; linux-api@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: [RFC PATCH] xfs: add a per-filesystem switch to force atomic CoW

[You don't often get email from john.garry@xxxxxxxxx. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Caution: External Email


On 11/23/26 20:11, Dave Chinner wrote:
>> The intended use is a controlled comparison of hardware-backed and
>> software-backed RWF_ATOMIC writes on the same hardware, without
>> having to construct misaligned mappings to trigger fallback. The
>> existing DEBUG-only always_cow control also affects ordinary writes,
>> which changes the workload being compared.
> Ok, so you want it for your test/dev environment, not production?
>
> I thought we could already change the block device characteristics
> (i.e. support hw atomic wirite or not) at the block device level?

The block layer just accepts whatever atomic properties is reported by the block driver and there is no method in the block layer to change these limits or turn them off.

Then for the only block drivers which today support atomic - NVMe and SCSI - similarly these we just use the atomic limits reported in the disk.

> If so, why do we
> need this at the fs level? If not, why isn't it the hardware atomic
> write behaviour configurable at the bdev level?
>
Thanks,
John
CONFIDENTIALITY NOTICE: This email and any files attached may contain confidential information and may be restricted from disclosure by corporate confidentiality guidelines, or applicable state and federal law. It is intended solely for the use of the person or entity to whom the email was addressed. If you are not the intended recipient of this message, be advised that any dissemination, distribution, or use of the contents of this message is strictly prohibited. Please delete this email from your system if you are not the intended recipient.