[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191126163315.GB3794@infradead.org>
Date: Tue, 26 Nov 2019 08:33:15 -0800
From: Christoph Hellwig <hch@...radead.org>
To: Damien Le Moal <damien.lemoal@....com>
Cc: linux-f2fs-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org, Jaegeuk Kim <jaegeuk@...nel.org>,
Chao Yu <yuchao0@...wei.com>, linux-fsdevel@...r.kernel.org,
Javier Gonzalez <javier@...igon.com>,
Shinichiro Kawasaki <shinichiro.kawasaki@....com>
Subject: Re: [PATCH] f2fs: Fix direct IO handling
On Tue, Nov 26, 2019 at 04:57:19PM +0900, Damien Le Moal wrote:
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 5755e897a5f0..8ac2d3b70022 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -1073,6 +1073,8 @@ int f2fs_preallocate_blocks(struct kiocb *iocb, struct iov_iter *from)
> int flag;
> int err = 0;
> bool direct_io = iocb->ki_flags & IOCB_DIRECT;
> + bool do_direct_io = direct_io &&
> + !f2fs_force_buffered_io(inode, iocb, from);
I don't think this is the right fix. The proper fix is to clear
IOCB_DIRECT when falling back to buffered I/O, preferably in the
filemap.c helpers as well.
Powered by blists - more mailing lists