[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <73f18b2a-6716-417f-a12a-8c6ea81f344f@oracle.com>
Date: Mon, 3 Mar 2025 13:45:38 +0000
From: John Garry <john.g.garry@...cle.com>
To: "Darrick J. Wong" <djwong@...nel.org>
Cc: brauner@...nel.org, cem@...nel.org, linux-xfs@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
ojaswin@...ux.ibm.com, ritesh.list@...il.com,
martin.petersen@...cle.com, tytso@....edu, linux-ext4@...r.kernel.org
Subject: Re: [PATCH v3 09/12] xfs: Add xfs_file_dio_write_atomic()
On 28/02/2025 15:39, Darrick J. Wong wrote:
>>> One last little nit here: if the filesystem doesn't have reflink, you
>>> can't use copy on write as a fallback.
>>>
>>> /*
>>> * The atomic write fallback uses out of place writes
>>> * implemented with the COW code, so we must fail the
>>> * atomic write if that is not supported.
>>> */
>>> if (!xfs_has_reflink(ip->i_mount))
>>> return -EOPNOTSUPP;
>>> dio_flags = IOMAP_DIO_ATOMIC_SW | IOMAP_DIO_FORCE_WAIT;
>>>
>> Currently the awu max is limited to 1x FS block if no reflink, and then we
>> check the write length against awu max in xfs_file_write_iter() for
>> IOCB_ATOMIC. And the xfs iomap would not request a SW-based atomic write for
>> 1x FS block. So in a around-about way we are checking it.
>>
>> So let me know if you would still like that additional check - it seems
>> sensible to add it.
> Yes, please. The more guardrails the better, particularly when someone
> gets around to enabling software-only RWF_ATOMIC.
ok, but I think that adding it at the start of
xfs_atomic_write_sw_iomap_begin() is a better place (to add it).
It seems a bit neater (than adding it here) with the retry handling and
locking/unlocking, and would save adding it in another possible future
callsite for xfs_atomic_write_sw_iomap_begin().
Cheers,
John
Powered by blists - more mailing lists