+ if (ret == -EAGAIN && !(iocb->ki_flags & IOCB_NOWAIT) &&One last little nit here: if the filesystem doesn't have reflink, you
+ !(dio_flags & IOMAP_DIO_ATOMIC_SW)) {
+ xfs_iunlock(ip, iolock);
+ dio_flags = IOMAP_DIO_ATOMIC_SW | IOMAP_DIO_FORCE_WAIT;
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;