Re: [PATCH v2] xfs: disallow atomic writes on DAX

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

cheers




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux