mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH 2/2] fuse: don't wait for a sync-init mount in fuse_uring_cmd()
       [not found] ` <20261116235814.60702-1-arsenova@a7snv.com>
@ 2026-11-17 21:47   ` Bernd Schubert
  0 siblings, 0 replies; only message in thread
From: Bernd Schubert @ 2026-11-17 21:47 UTC (permalink / raw)
  To: Yun Wang, Miklos Szeredi; +Cc: Joanne Koong, fuse-devel, linux-kernel



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;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-17 21:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20261117075632.59959.p12-0-arsenova@a7snv.com>
     [not found] ` <20261116235814.60702-1-arsenova@a7snv.com>
2026-11-17 21:47   ` [PATCH 2/2] fuse: don't wait for a sync-init mount in fuse_uring_cmd() Bernd Schubert

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®