[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <174787198704.1484996.5526860565441150226.stgit@frogsfrogsfrogs>
Date: Wed, 21 May 2025 17:14:45 -0700
From: "Darrick J. Wong" <djwong@...nel.org>
To: tytso@....edu
Cc: John@...ves.net, linux-ext4@...r.kernel.org, miklos@...redi.hu,
joannelkoong@...il.com, bernd@...ernd.com, linux-fsdevel@...r.kernel.org
Subject: [PATCH 15/16] fuse2fs: re-enable the block device pagecache for
metadata IO
From: Darrick J. Wong <djwong@...nel.org>
Back in "fuse2fs: always use directio disk reads with fuse2fs", we
started using directio for all libext2fs disk IO to deal with cache
coherency issues between the unix io manager's disk cache, the block
device page cache, and the file data blocks being read and written to
disk by the kernel itself.
Now that we've turned off all regular file data block IO in libext2fs,
we don't need that and can go back to the old way, which is a lot
faster for metadata operations.
Signed-off-by: "Darrick J. Wong" <djwong@...nel.org>
---
misc/fuse2fs.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index ba8c5f301625c6..f31aee5af5aad9 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -1128,8 +1128,12 @@ static void *op_init(struct fuse_conn_info *conn
* filesystem in directio mode to avoid cache coherency issues when
* reading file data. If we can't open the bdev in directio mode, we
* must not use iomap.
+ *
+ * If we know that the kernel can handle all regular file IO for us,
+ * then there is no cache coherency issue and we can use buffered reads
+ * for all IO, which will all be filesystem metadata.
*/
- if (iomap_enabled(ff))
+ if (iomap_enabled(ff) && !iomap_does_fileio(ff))
ff->directio = 1;
#endif
Powered by blists - more mailing lists