[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250228153922.GY6242@frogsfrogsfrogs>
Date: Fri, 28 Feb 2025 07:39:22 -0800
From: "Darrick J. Wong" <djwong@...nel.org>
To: John Garry <john.g.garry@...cle.com>
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 Fri, Feb 28, 2025 at 07:45:59AM +0000, John Garry wrote:
> On 28/02/2025 01:19, Darrick J. Wong wrote:
> > > + if (ret == -EAGAIN && !(iocb->ki_flags & IOCB_NOWAIT) &&
> > > + !(dio_flags & IOMAP_DIO_ATOMIC_SW)) {
> > > + xfs_iunlock(ip, iolock);
> > > + dio_flags = IOMAP_DIO_ATOMIC_SW | IOMAP_DIO_FORCE_WAIT;
> > 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.
--D
> Cheers,
> John
>
>
Powered by blists - more mailing lists