From: John Garry <john.garry@linux.dev>
To: Dave Chinner <dgc@kernel.org>
Cc: Wayne Gao <Wayne.Gao1@solidigm.com>,
"cem@kernel.org" <cem@kernel.org>,
"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
"linux-api@vger.kernel.org" <linux-api@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] xfs: add a per-filesystem switch to force atomic CoW
Date: Wed, 25 Nov 2026 09:18:12 +0000 [thread overview]
Message-ID: <a337f9fc-b6ef-48c4-ad98-52972b10b4c9@linux.dev> (raw)
In-Reply-To: <awXuAESDkLr1nd3n@dread>
On 11/24/26 20:05, Dave Chinner wrote:
>>> 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.
> Isn't that a bit of an oversight? Lots of the hardware related IO
> capabilities are configurable in the bdev queue (e.g. max io sizes,
> max discard/unmap sizes, max queue depth, etc).
Generally anything which affects atomic limits is fixed. As you
mentioned, there is max io sizes, which can be configured from sysfs -
however, for HW atomics we ignore max_sectors and just pay attention to
max_hw_sectors.
For any normal IO, the block layer can slice and dice the IO any way it
wants. HW atomics are not like this, and the IO must be submitted as a
single bio/request. For any dynamically changing HW atomic limits, we
would always have the TOCTOU challenge, i.e. bdev limits can change
between checking atomic limits and submitting an atomic IO.
>
> Sure, they are initially populated by the hardware values, but the
> user can then override them (e.g. via udev rules) and that means we
> don't have need to add 'override the <bdev queue property>'
> management interfaces to every filesystem that supports those
> specific bdev hardware offloads.
>
>> 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.
> That seems to be inconsistent with how we manage other hardware
> offload size limits on block devices. These are -not- filesystem
> properties, and we should not be trying to manage them at the
> filesystem level.
As mentioned, HW atomic IO is special in this regard. Now for XFS we do
read the limits once at mount time. We could read the limits dynamically
instead, but it still has the TOCTOU problem, above.
Thanks,
John
next prev parent reply other threads:[~2026-11-25 9:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-21 15:47 [RFC PATCH] xfs: add a per-filesystem switch to force atomic CoW Wayne Gao
2026-11-23 11:44 ` John Garry
2026-11-23 13:42 ` Pankaj Raghav (Samsung)
2026-11-23 20:11 ` Dave Chinner
2026-11-24 8:32 ` John Garry
2026-11-24 17:19 ` Wayne Gao
2026-11-24 20:05 ` Dave Chinner
2026-11-25 9:18 ` John Garry [this message]
2026-11-24 17:16 ` Wayne Gao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a337f9fc-b6ef-48c4-ad98-52972b10b4c9@linux.dev \
--to=john.garry@linux.dev \
--cc=Wayne.Gao1@solidigm.com \
--cc=cem@kernel.org \
--cc=dgc@kernel.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox