linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: hch@lst.de, cem@kernel.org, linux-xfs@vger.kernel.org,
	linux-ext4 <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH v2] xfs: disallow atomic writes on DAX
Date: Wed, 23 Jul 2025 08:36:29 +0100	[thread overview]
Message-ID: <0433b188-db22-4551-a0b3-c908a00a7239@oracle.com> (raw)
In-Reply-To: <20250722175820.GV2672070@frogsfrogsfrogs>

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@kernel.org>
>> Fixes: 9dffc58f2384 ("xfs: update atomic write limits")
>> Signed-off-by: John Garry<john.g.garry@oracle.com>
> Otherwise seems reasonable to me...
> Reviewed-by: "Darrick J. Wong"<djwong@kernel.org>

cheers

  reply	other threads:[~2025-07-23  7:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250722150016.3282435-1-john.g.garry@oracle.com>
2025-07-22 17:58 ` [PATCH v2] xfs: disallow atomic writes on DAX Darrick J. Wong
2025-07-23  7:36   ` John Garry [this message]
2025-08-05  4:32   ` Ritesh Harjani

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=0433b188-db22-4551-a0b3-c908a00a7239@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-ext4@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;
as well as URLs for NNTP newsgroup(s).