From e915a28ec44ba0f5345eed9985e862ebe13104cb Mon Sep 17 00:00:00 2001 From: Bernd Schubert Date: Sun, 20 Jul 2025 15:51:55 +0200 Subject: Split fuse-io-uring startup Start the ring threads before sending fuse_reply_ok() so that io-uring startup issues can be non-fatal. Signed-off-by: Bernd Schubert --- lib/fuse_lowlevel.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lib/fuse_lowlevel.c') diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index 9731b44..6afcecd 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -2897,18 +2897,22 @@ _do_init(fuse_req_t req, const fuse_ino_t nodeid, const void *op_in, else if (arg->minor < 23) outargsize = FUSE_COMPAT_22_INIT_OUT_SIZE; - send_reply_ok(req, &outarg, outargsize); - - /* XXX: Split the start, and send SQEs only after send_reply_ok() */ + /* XXX: Add an option to make non-available io-uring fatal */ if (enable_io_uring) { int ring_rc = fuse_uring_start(se); if (ring_rc != 0) { - fuse_log(FUSE_LOG_ERR, "fuse: failed to start io-uring: %s\n", + fuse_log(FUSE_LOG_INFO, + "fuse: failed to start io-uring: %s\n", strerror(ring_rc)); - fuse_session_exit(se); + outargflags &= ~FUSE_OVER_IO_URING; + enable_io_uring = false; } } + + send_reply_ok(req, &outarg, outargsize); + if (enable_io_uring) + fuse_uring_wake_ring_threads(se); } static __attribute__((no_sanitize("thread"))) void -- cgit v1.2.3