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

From: Wayne Gao

Date: Sat Nov 28 2026 - 09:09:42 EST


@Dave Chinner

Dave, thank you so much for the great suggestion, you prefer we add this switch at mount time, not a sysfs flag. Let me try to work another PR review with this approach.

-----Original Message-----
From: Dave Chinner <dgc@xxxxxxxxxx>
Sent: Tuesday, November 24, 2026 4:11 AM
To: 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 dgc@xxxxxxxxxx. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Caution: External Email


On Sat, Nov 21, 2026 at 03:47:32PM +0000, Wayne Gao wrote:
>
>
> Hardware-capable devices normally prefer hardware atomic writes,
> making it difficult to exercise the software CoW path
> deterministically without changing file layouts or affecting ordinary writes.

Why would we want to do this at runtime on production systems?


....

> 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? 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?

i.e. I don't understand why 'unmount; change bdev setting; mount' is the obvious answer for back-to-back behavioural characterisation on the same hardware and filesystem with different configurations?

Cheers,

Dave.
--
Dave Chinner
dgc@xxxxxxxxxx
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.