public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Bernd Schubert <bernd@bsbernd.com>
Cc: bschubert@ddn.com, joannelkoong@gmail.com,
	linux-fsdevel@vger.kernel.org, miklos@szeredi.hu, neal@gompa.dev
Subject: Re: [GIT PULL] libfuse: run fuse servers as a contained service
Date: Sun, 8 Mar 2026 19:27:10 -0700	[thread overview]
Message-ID: <20260309022710.GA6012@frogsfrogsfrogs> (raw)
In-Reply-To: <20260304232353.GS13829@frogsfrogsfrogs>

On Wed, Mar 04, 2026 at 03:23:53PM -0800, Darrick J. Wong wrote:
> On Wed, Mar 04, 2026 at 02:36:03PM +0100, Bernd Schubert wrote:
> > 
> > 
> > On 3/4/26 01:11, Darrick J. Wong wrote:
> > > Hi Bernd,
> > > 
> > > Please pull this branch with changes for libfuse.
> > > 
> > > As usual, I did a test-merge with the main upstream branch as of a few
> > > minutes ago, and didn't see any conflicts.  Please let me know if you
> > > encounter any problems.
> > 
> > Hi Darrick,
> > 
> > quite some problems actually ;)
> > 
> > https://github.com/libfuse/libfuse/pull/1444
> > 
> > Basically everything fails.  Build test with
> > 
> > ../../../home/runner/work/libfuse/libfuse/lib/fuse_service.c:24:10:
> > fatal error: 'systemd/sd-daemon.h' file not found
> >    24 | #include <systemd/sd-daemon.h>
> > 
> > 
> > Two issues here:
> > a) meson is not testing for sd-daemon.h?
> > a.1) If not available needs to disable that service? Because I don't
> > think BSD has support for systemd.
> > 
> > b) .github/workflow/*.yml files need to be adjusted to add in the new
> > dependency.
> > 
> > 
> > Please also have a look at checkpatch (which is a plain linux copy) and
> > the spelling test failures.
> 
> I have a few questions after running checkpatch.pl (the one in the
> libfuse repo):
> 
> 1. What are the error return conventions for libfuse functions?
> 
>    The lowlevel library mostly seems to return 0 for succes or negative
>    errno, but not all of them are like that, e.g. fuse_parse_cmdline*.
> 
>    The rest of libfuse mostly seems to return 0 for success or -1 for
>    error, though it's unclear if they set errno to anything?
> 
>    This comes up because checkpatch complains about "return ENOTBLK",
>    saying that it should be returning -ENOTBLK.  But I'm already sorta
>    confused because libfuse and its examples use positive and negative
>    errno inconsistently.

Hi Bernd,

Having spent a few days looking through lib/fuse*.c more carefully, I've
come to the conclusion that most lowlevel library functions return 0 or
negative errno on failure, and they often call fuse_log to complain
about whatever failed.  Oddly, fuse_reply_err takes positive errno and
ll servers are required to handle sign conversions correctly.  The high
level fuse library does this inversion.

If that sounds like a reasonable approach for fuse_service.c then I'll
convert it to log and return negative errno like the lowlevel library
does.  Right now it mostly sets errno and returns -1, and isn't
completely consistent about fuse_log().  util/mount_service.c will get
changed to fprintf to stderr and return negative errno on failure.

For *_service.c functions that pass around fds from files opened on the
other side of the service socket, a failure to open a file will result
in the negative errno being sent in place of an fd.

How does that sound?

--D

> 2. There's no strscpy, but the check is left on, and there are plenty of
>    users in libfuse.
> 
> 3. Comments at the top of files -- checkpatch complains that the
>    non-first lines of a multiline C comment should start with " * "but
>    not all of them do that.  Should I just do C comments the way
>    checkpatch wants?  Or keep going with the existing code?
> 
> --D
> 
> > Thanks,
> > Bernd
> > 
> > 
> 

  reply	other threads:[~2026-03-09  2:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04  0:11 [GIT PULL] libfuse: run fuse servers as a contained service Darrick J. Wong
2026-03-04 13:36 ` Bernd Schubert
2026-03-04 17:06   ` Darrick J. Wong
2026-03-04 18:06     ` Darrick J. Wong
2026-03-04 19:29       ` Bernd Schubert
2026-03-04 21:08         ` Darrick J. Wong
2026-03-04 23:23   ` Darrick J. Wong
2026-03-09  2:27     ` Darrick J. Wong [this message]
2026-03-09 17:34       ` Bernd Schubert
2026-03-09 18:35         ` Darrick J. Wong

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=20260309022710.GA6012@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=bernd@bsbernd.com \
    --cc=bschubert@ddn.com \
    --cc=joannelkoong@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=neal@gompa.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