From: Bernd Schubert <bernd@bsbernd.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: fuse-devel@lists.linux.dev
Subject: Re: [PATCH 09/10] fuse mount: Do not set sync_init when sync_init was not used
Date: Sun, 10 May 2026 19:04:45 +0200 [thread overview]
Message-ID: <e4bfd319-d12f-4581-b8fb-da47459bb529@bsbernd.com> (raw)
In-Reply-To: <20260509003534.GN2241589@frogsfrogsfrogs>
On 5/9/26 02:35, Darrick J. Wong wrote:
> On Fri, May 08, 2026 at 06:39:12PM +0200, Bernd Schubert via B4 Relay wrote:
>> From: Bernd Schubert <bernd@bsbernd.com>
>>
>> synchronous init is just a hint and we cannot fail on it, but for
>> daemonization we need to do know when it was actually used.
>> Bug was that se->sync_init() was set unconditionally on mount success.
>>
>> Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
>> ---
>> lib/fuse_lowlevel.c | 22 +++++++++++++++-------
>> 1 file changed, 15 insertions(+), 7 deletions(-)
>>
>> diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
>> index 6e078e82..60b936c3 100644
>> --- a/lib/fuse_lowlevel.c
>> +++ b/lib/fuse_lowlevel.c
>> @@ -4471,10 +4471,13 @@ static void *session_sync_init_worker(void *data)
>> }
>>
>> /* Enable synchronous FUSE_INIT and start worker thread */
>> -static int session_start_sync_init(struct fuse_session *se, int fd)
>> +static int session_start_sync_init(struct fuse_session *se, int fd,
>> + bool *is_sync_init)
>> {
>> int err, res;
>>
>> + *is_sync_init = false;
>> +
>> /*
>> * Older fuse servers do not set want_sync_init or start the new
>> * daemonize code, so they get async init.
>> @@ -4536,6 +4539,8 @@ static int session_start_sync_init(struct fuse_session *se, int fd)
>> return -EIO;
>> }
>>
>> + *is_sync_init = true;
>
> Hrm. So we only end up with return value == 0 and *is_sync_init==true
> if SYNC_INIT was enabled via ioctl and all the pthread stuff is ready to
> go. The other two outcomes are:
>
> 1. return == 0 && *is_sync_init==false if the kernel didn't let us use
> synchronous init
>
> 2. return != 0 if something broke and we just want to abort
>
> If that's all correct then I've understood this patch well enough to say
Exactly! I'm going to amend the commit message.
> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
>
> --D
>
Thanks,
Bernd
next prev parent reply other threads:[~2026-05-10 17:04 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 16:39 [PATCH 00/10] libfuse: new mount API and SYNC_INIT fixes and tests Bernd Schubert via B4 Relay
2026-05-08 16:39 ` [PATCH 01/10] test: register pytest run as a meson test Bernd Schubert via B4 Relay
2026-05-08 23:53 ` Darrick J. Wong
2026-05-08 16:39 ` [PATCH 02/10] Add tests to verify that mountinfo matches requested options Bernd Schubert via B4 Relay
2026-05-08 23:59 ` Darrick J. Wong
2026-05-08 16:39 ` [PATCH 03/10] test: assert ro/rw, nosuid/suid, nodev/dev round-trip via fsmount Bernd Schubert via B4 Relay
2026-05-09 0:04 ` Darrick J. Wong
2026-05-08 16:39 ` [PATCH 04/10] New mount API: read-only option is for fsmount() and fsconfig() Bernd Schubert via B4 Relay
2026-05-09 0:17 ` Darrick J. Wong
2026-05-08 16:39 ` [PATCH 05/10] libfuse: don't use SYNC_INIT unless asked for Bernd Schubert via B4 Relay
2026-05-08 16:39 ` [PATCH 06/10] example: silence add_languages warning by setting 'native: false' Bernd Schubert via B4 Relay
2026-05-09 0:23 ` Darrick J. Wong
2026-05-08 16:39 ` [PATCH 07/10] mount: clarify kernel_opts vs mnt_opts vs flags in fuse_kern_fsmount Bernd Schubert via B4 Relay
2026-05-09 0:27 ` Darrick J. Wong
2026-05-10 17:21 ` Bernd Schubert
2026-05-08 16:39 ` [PATCH 08/10] fuse_daemonize_early_start: Disallow daemonization when already active Bernd Schubert via B4 Relay
2026-05-09 0:30 ` Darrick J. Wong
2026-05-10 16:53 ` Bernd Schubert
2026-05-10 17:01 ` Bernd Schubert
2026-05-08 16:39 ` [PATCH 09/10] fuse mount: Do not set sync_init when sync_init was not used Bernd Schubert via B4 Relay
2026-05-09 0:35 ` Darrick J. Wong
2026-05-10 17:04 ` Bernd Schubert [this message]
2026-05-08 16:39 ` [PATCH 10/10] highlevel: Switch fuse_main_real_versioned() to fuse_daemonize_early() Bernd Schubert via B4 Relay
2026-05-09 0:38 ` Darrick J. Wong
2026-05-10 17:19 ` Bernd Schubert
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=e4bfd319-d12f-4581-b8fb-da47459bb529@bsbernd.com \
--to=bernd@bsbernd.com \
--cc=djwong@kernel.org \
--cc=fuse-devel@lists.linux.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