[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <175279461322.715479.12194821289069351679.stgit@frogsfrogsfrogs>
Date: Thu, 17 Jul 2025 16:43:33 -0700
From: "Darrick J. Wong" <djwong@...nel.org>
To: tytso@....edu
Cc: joannelkoong@...il.com, miklos@...redi.hu, John@...ves.net,
linux-fsdevel@...r.kernel.org, bernd@...ernd.com, linux-ext4@...r.kernel.org,
neal@...pa.dev
Subject: [PATCH 16/22] 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 9604f06e69bc90..9a62971f8dbba7 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -1295,8 +1295,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 (fuse2fs_iomap_enabled(ff))
+ if (fuse2fs_iomap_enabled(ff) && !fuse2fs_iomap_does_fileio(ff))
ff->directio = 1;
#endif
Powered by blists - more mailing lists