From: Russ Fellows <russ.fellows@gmail.com>
To: miklos@szeredi.hu
Cc: fuse-devel@lists.linux.dev, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, amir73il@gmail.com,
Russ Fellows <rfellows@xlrait.dev>
Subject: [PATCH v2 1/2] fuse: preserve FOPEN_PARALLEL_DIRECT_WRITES for passthrough opens
Date: Tue, 16 Jun 2026 01:44:18 +0000 [thread overview]
Message-ID: <20260616014419.7913-2-russ.fellows@gmail.com> (raw)
In-Reply-To: <20260616014419.7913-1-russ.fellows@gmail.com>
From: Russ Fellows <rfellows@xlrait.dev>
fuse_file_io_open() currently strips FOPEN_PARALLEL_DIRECT_WRITES whenever FOPEN_DIRECT_IO is absent. That rule is correct for the regular direct-IO path, but it is too strict for passthrough opens.
Passthrough I/O already bypasses the page cache through the backing file, so it does not need FOPEN_DIRECT_IO to preserve direct-I/O semantics. Clearing the parallel-write flag for passthrough opens causes the kernel to drop the server's request for parallel direct writes before the passthrough write path ever sees it.
Keep FOPEN_PARALLEL_DIRECT_WRITES for opens that also carry FOPEN_PASSTHROUGH, and continue to clear it for non-passthrough opens that lack FOPEN_DIRECT_IO.
This is a prerequisite for passthrough write parallelism: without it, the subsequent shared-lock path never activates.
Signed-off-by: Russ Fellows <rfellows@xlrait.dev>
---
fs/fuse/iomode.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/fuse/iomode.c b/fs/fuse/iomode.c
index c99e285f3..0301a48d8 100644
--- a/fs/fuse/iomode.c
+++ b/fs/fuse/iomode.c
@@ -216,9 +216,12 @@ int fuse_file_io_open(struct file *file, struct inode *inode)
goto fail;
/*
- * FOPEN_PARALLEL_DIRECT_WRITES requires FOPEN_DIRECT_IO.
+ * FOPEN_PARALLEL_DIRECT_WRITES requires FOPEN_DIRECT_IO, except for
+ * passthrough opens which bypass the page cache regardless and do not
+ * need FOPEN_DIRECT_IO to guarantee direct I/O semantics.
*/
- if (!(ff->open_flags & FOPEN_DIRECT_IO))
+ if (!(ff->open_flags & FOPEN_DIRECT_IO) &&
+ !(ff->open_flags & FOPEN_PASSTHROUGH))
ff->open_flags &= ~FOPEN_PARALLEL_DIRECT_WRITES;
/*
--
2.51.0
next prev parent reply other threads:[~2026-06-16 1:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 3:19 [PATCH 0/2] fuse: fix and optimize parallel writes on passthrough mounts Russ Fellows
2026-05-29 3:19 ` [PATCH 1/2] fuse: fix FOPEN_PARALLEL_DIRECT_WRITES being ignored for passthrough writes Russ Fellows
2026-06-01 18:52 ` Amir Goldstein
2026-06-01 19:25 ` Russ Fellows
2026-06-01 20:23 ` Amir Goldstein
2026-05-29 3:19 ` [PATCH 2/2] fuse: reduce fi->lock contention on parallel direct I/O Russ Fellows
2026-06-16 1:44 ` [PATCH v2 0/2] fuse: fix passthrough parallel direct writes with a minimal series Russ Fellows
2026-06-16 1:44 ` Russ Fellows [this message]
2026-06-16 11:06 ` [PATCH v2 1/2] fuse: preserve FOPEN_PARALLEL_DIRECT_WRITES for passthrough opens Amir Goldstein
2026-06-16 1:44 ` [PATCH v2 2/2] fuse: allow parallel direct writes in passthrough write_iter Russ Fellows
2026-06-16 11:50 ` Amir Goldstein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260616014419.7913-2-russ.fellows@gmail.com \
--to=russ.fellows@gmail.com \
--cc=amir73il@gmail.com \
--cc=fuse-devel@lists.linux.dev \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=rfellows@xlrait.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome