From: Bernd Schubert <bernd@bsbernd.com>
To: Yun Wang <arsenova@a7snv.com>, Miklos Szeredi <miklos@szeredi.hu>
Cc: Joanne Koong <joannelkoong@gmail.com>,
fuse-devel@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] fuse: don't wait for a sync-init mount in fuse_uring_cmd()
Date: Tue, 17 Nov 2026 22:47:21 +0100 [thread overview]
Message-ID: <7bb720d9-30ef-4d3f-8ab8-81c5fe2e0fe1@bsbernd.com> (raw)
In-Reply-To: <20261116235814.60702-1-arsenova@a7snv.com>
On 11/17/26 00:58, Yun Wang wrote:
> fuse_uring_cmd() gets the device with fuse_get_dev(), which waits for
> the mount of a device in sync-init mode. io_uring normally issues the
> command from the task that called io_uring_enter(2), so an
> IORING_OP_URING_CMD on such a device before the mount puts that task
> to sleep until the mount or a signal. This happens before the
> enable_uring check, so also when fuse-over-io-uring is disabled.
>
> Until FUSE_INIT has completed, fuse_uring_cmd() returns -EAGAIN anyway
> and the server has to send the command again later. Return -EAGAIN
> at once when the device is not mounted yet either, using
> fuse_get_dev_nowait() from the previous patch, and don't log "No fuse
> device found" for it.
And what is if io-uring is enabled? Userspace busy loop until the device
is available? I don't think that is nice.
Thanks,
Bernd
>
> Fixes: dfb84c330794 ("fuse: allow synchronous FUSE_INIT")
> Signed-off-by: Yun Wang <arsenova@a7snv.com>
> ---
> fs/fuse/dev_uring.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c
> index 460776cd69..0f725172ae 100644
> --- a/fs/fuse/dev_uring.c
> +++ b/fs/fuse/dev_uring.c
> @@ -1664,9 +1664,15 @@ int fuse_uring_cmd(struct io_uring_cmd *cmd, unsigned int issue_flags)
> if (!(issue_flags & IO_URING_F_SQE128))
> return -EINVAL;
>
> - fud = fuse_get_dev(cmd->file);
> + /*
> + * Don't wait for the mount of a sync-init device: this may run in
> + * the task that called io_uring_enter(), and the ring can't be
> + * registered before FUSE_INIT anyway, see the -EAGAIN below.
> + */
> + fud = fuse_get_dev_nowait(cmd->file);
> if (IS_ERR(fud)) {
> - pr_info_ratelimited("No fuse device found\n");
> + if (PTR_ERR(fud) != -EAGAIN)
> + pr_info_ratelimited("No fuse device found\n");
> return PTR_ERR(fud);
> }
> fch = fud->chan;
parent reply other threads:[~2026-11-17 21:47 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20261116235814.60702-1-arsenova@a7snv.com>]
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=7bb720d9-30ef-4d3f-8ab8-81c5fe2e0fe1@bsbernd.com \
--to=bernd@bsbernd.com \
--cc=arsenova@a7snv.com \
--cc=fuse-devel@lists.linux.dev \
--cc=joannelkoong@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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
all inboxes | Powered by JetHome®