[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fff46380-1e01-473d-860e-19d5a02a7d1c@oracle.com>
Date: Tue, 29 Oct 2024 08:57:50 +0000
From: John Garry <john.g.garry@...cle.com>
To: "Ritesh Harjani (IBM)" <ritesh.list@...il.com>, linux-ext4@...r.kernel.org
Cc: Theodore Ts'o <tytso@....edu>, Jan Kara <jack@...e.cz>,
"Darrick J . Wong" <djwong@...nel.org>,
Christoph Hellwig
<hch@...radead.org>,
Ojaswin Mujoo <ojaswin@...ux.ibm.com>,
Dave Chinner <david@...morbit.com>, linux-kernel@...r.kernel.org,
linux-xfs@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v2 4/4] ext4: Do not fallback to buffered-io for DIO
atomic write
On 27/10/2024 18:17, Ritesh Harjani (IBM) wrote:
> iomap can return -ENOTBLK if pagecache invalidation fails.
> Let's make sure if -ENOTBLK is ever returned for atomic
> writes than we fail the write request (-EIO) instead of
> fallback to buffered-io.
>
> Reviewed-by: Darrick J. Wong <djwong@...nel.org>
> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@...il.com>
I am not sure if you plan on dropping this patch...
> ---
> fs/ext4/file.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ext4/file.c b/fs/ext4/file.c
> index 8116bd78910b..22d31b4fdff3 100644
> --- a/fs/ext4/file.c
> +++ b/fs/ext4/file.c
> @@ -576,8 +576,18 @@ static ssize_t ext4_dio_write_iter(struct kiocb *iocb, struct iov_iter *from)
> iomap_ops = &ext4_iomap_overwrite_ops;
> ret = iomap_dio_rw(iocb, from, iomap_ops, &ext4_dio_write_ops,
> dio_flags, NULL, 0);
> - if (ret == -ENOTBLK)
> + if (ret == -ENOTBLK) {
> ret = 0;
> + /*
> + * iomap can return -ENOTBLK if pagecache invalidation fails.
> + * Let's make sure if -ENOTBLK is ever returned for atomic
> + * writes than we fail the write request instead of fallback
> + * to buffered-io.
> + */
> + if (iocb->ki_flags & IOCB_ATOMIC)
> + ret = -EIO;
> + }
> +
> if (extend) {
> /*
> * We always perform extending DIO write synchronously so by
> --
> 2.46.0
>
Powered by blists - more mailing lists