[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0433b188-db22-4551-a0b3-c908a00a7239@oracle.com>
Date: Wed, 23 Jul 2025 08:36:29 +0100
From: John Garry <john.g.garry@...cle.com>
To: "Darrick J. Wong" <djwong@...nel.org>
Cc: hch@....de, cem@...nel.org, linux-xfs@...r.kernel.org,
linux-ext4 <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH v2] xfs: disallow atomic writes on DAX
On 22/07/2025 18:58, Darrick J. Wong wrote:
> [cc linux-ext4 because ext4_file_write_iter has the same problem]
>
> On Tue, Jul 22, 2025 at 03:00:16PM +0000, John Garry wrote:
>> Atomic writes are not currently supported for DAX, but two problems exist:
>> - we may go down DAX write path for IOCB_ATOMIC, which does not handle
>> IOCB_ATOMIC properly
>> - we report non-zero atomic write limits in statx (for DAX inodes)
>>
>> We may want atomic writes support on DAX in future, but just disallow for
>> now.
>>
>> For this, ensure when IOCB_ATOMIC is set that we check the write size
>> versus the atomic write min and max before branching off to the DAX write
>> path. This is not strictly required for DAX, as we should not get this far
>> in the write path as FMODE_CAN_ATOMIC_WRITE should not be set.
>>
>> In addition, due to reflink being supported for DAX, we automatically get
>> CoW-based atomic writes support being advertised. Remedy this by
>> disallowing atomic writes for a DAX inode for both sw and hw modes.
> You might want to add a separate patch to insert:
>
> if (WARN_ON_ONCE(iocb->ki_flags & IOCB_ATOMIC))
> return -EIO;
>
> into dax_iomap_rw to make it clear that DAX doesn't support ATOMIC
> writes.
ok, I can do that.
>
>> Reported-by: Darrick J. Wong<djwong@...nel.org>
>> Fixes: 9dffc58f2384 ("xfs: update atomic write limits")
>> Signed-off-by: John Garry<john.g.garry@...cle.com>
> Otherwise seems reasonable to me...
> Reviewed-by: "Darrick J. Wong"<djwong@...nel.org>
cheers
Powered by blists - more mailing lists