public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Horst Birthelmer <horst@birthelmer.de>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Horst Birthelmer <horst@birthelmer.com>,
	 Bernd Schubert <bschubert@ddn.com>,
	Joanne Koong <joannelkoong@gmail.com>,
	 Luis Henriques <luis@igalia.com>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	 Horst Birthelmer <hbirthelmer@ddn.com>
Subject: Re: Re: Re: Re: Re: [PATCH v5 1/3] fuse: add compound command to combine multiple requests
Date: Thu, 12 Feb 2026 13:33:57 +0100	[thread overview]
Message-ID: <aY3Gkh8DKW_QTuTS@fedora.fritz.box> (raw)
In-Reply-To: <CAJfpegvZiBb6oJCeTeLDiHdUsKEkSLuifrmmMh3aRnXFBzkRkw@mail.gmail.com>

On Thu, Feb 12, 2026 at 01:10:19PM +0100, Miklos Szeredi wrote:
> On Thu, 12 Feb 2026 at 11:48, Horst Birthelmer <horst@birthelmer.de> wrote:
> > On Thu, Feb 12, 2026 at 11:23:56AM +0100, Miklos Szeredi wrote:
> > > On Thu, 12 Feb 2026 at 10:53, Horst Birthelmer <horst@birthelmer.de> wrote:
> > > >
> > > >
> > > > Exactly. And the FUSE_COMPOUND_SEPARABLE was actually there to tell the fuse server,
> > > > that we know that this is not done in this case, so the requests can be processed
> > > > 'separately'.
> > > > If that is missing the fuse server has to look at the combination and decide wether it
> > > > will execute it as a 'compound' or return an error.
> > >
> > > I'd rather add some sub-op header flag that how to fill the missing
> > > input.  E.g. use the nodeid from the previous op's result.
> > >
> > > If there's no flag, then the op is "separable".
> > >
> >
> > This makes the handling on the fuse server side unnecessarily harder.
> > With the current way I can check the flag in the compound header and let libfuse handle the
> > compound by calling the request handlers separately, and not worry about a thing.
> >
> > If the flag is not there, the fuse server itself
> > (passthrough_hp from the PR already demonstrates this) has to handle the whole compound
> > as a whole. I'm confident that this way we can handle pretty much every semantically
> > overloaded combination.
> 
> Yeah, that's one strategy.  I'm saying that supporting compounds that
> are not "separable" within libfuse should be possible, given a few
> constraints.  Something very similar is done in io-uring.  It adds
> complexity, but I think it's worth it.
> 
> I also have the feeling that decoding requests should always be done
> by the library, and if the server wants to handle compounds in special
> way (because for example the network protocol also supports that),
> then it should be done by bracketing the regular operation callbacks
> with compound callbacks, that can allocate/free context which can be
> used by the operation callbacks.
> 

Right now we don't have it completely like this but very similar.
The fuse server makes the final decision not the library.

If it doesn't support a combination it gives control back to libfuse
and if the FUSE_COMPOUND_SEPARABLE flag is set libfuse calls the handlers
sequencially.

The only drawback here is, (this actually makes handling a lot easier)
that we have to have valid and complete results for all requests 
that are in the compound.

> Not sure if I'm making sense.
> 

I think we're getting there that I understand your perspective better.

> >
> > The other way would make the handling in libfuse or in the lowest level of the fuse server
> > (for fuse servers that don't use libfuse) almost impossible without parsing all the requests
> > and all the flags to know that we would have been able to get away with very little work.
> >
> > I had thought of a hierarchical parsing of the compound.
> > The fuse server can decide
> > 1. does it handle compounds at all
> > 2. does it support this particular compound (based on the opcodes and the compound flags
> > and the particular capabilities of the fuse server)
> > 3. if the particular compound can not be handled can libfuse handle it for us?
> >
> > This way we can have real atomic operations in fuse server, where it supports it.
> 
> Yes, that's something definitely useful.   But I also think that the
> fuse *filesystem* code in the kernel should not have to worry about
> whether a particular server supports a particular combination of
> operations and fall back to calling ops sequentially if it doesn't.
> This could be all handled transparently in the layers below
> (fs/fuse/dev.c, lib/fuse_lowelevel.c).

I actually like this approach.
lib/fuse_lowlevel.c is already there ... the kernel part does not do this yet.
I'll have a look and come up with a new version.

> > I don't understand yet, why.
> > I think we could actually implement a real atomic open if we craft a compound for it and
> > the fuse server supports it. If not, we can go back to the way it is handled now.
> >
> > What am I missing here?
> 
> I'm saying that there's no point in splitting FUSE_CREATE into
> FUSE_LOOKUP + FUSE_MKNOD compound, since that would:
> 
> a) complicate the logic of joining the ops (which I was taking about above)
> b) add redundant information (parent and name are the same in both ops)
> c) we already have an atomic op that does both, so why make it larger
> and less efficient?
> 
> Thanks,
> Miklos

Thanks,
Horst

  reply	other threads:[~2026-02-12 12:41 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-10  8:46 [PATCH v5 0/3] fuse: compound commands Horst Birthelmer
2026-02-10  8:46 ` [PATCH v5 1/3] fuse: add compound command to combine multiple requests Horst Birthelmer
2026-02-11 14:59   ` Luis Henriques
2026-02-11 16:18     ` Horst Birthelmer
2026-02-11 16:13   ` Miklos Szeredi
2026-02-11 16:35     ` Horst Birthelmer
2026-02-12  9:38       ` Miklos Szeredi
2026-02-12  9:53         ` Horst Birthelmer
2026-02-12 10:23           ` Miklos Szeredi
2026-02-12 10:48             ` Horst Birthelmer
2026-02-12 12:10               ` Miklos Szeredi
2026-02-12 12:33                 ` Horst Birthelmer [this message]
2026-02-14  1:04                   ` Joanne Koong
2026-02-11 20:36     ` Bernd Schubert
2026-02-12  9:07       ` Miklos Szeredi
2026-02-12  9:48         ` Bernd Schubert
2026-02-12 10:16           ` Miklos Szeredi
2026-02-12 10:43             ` Bernd Schubert
2026-02-12 11:44               ` Horst Birthelmer
2026-02-14  1:35                 ` Joanne Koong
2026-02-14 12:54                   ` Bernd Schubert
2026-02-14 17:50                   ` Re: " Horst Birthelmer
2026-02-16 11:43                     ` Miklos Szeredi
2026-02-16 15:22                       ` Miklos Szeredi
2026-02-17  7:26                         ` Horst Birthelmer
2026-02-17  7:28                       ` Horst Birthelmer
2026-03-06  0:52                     ` Joanne Koong
2026-03-06  8:17                       ` Horst Birthelmer
2026-02-12 11:55               ` Miklos Szeredi
2026-02-10  8:46 ` [PATCH v5 2/3] fuse: create helper functions for filling in fuse args for open and getattr Horst Birthelmer
2026-02-10  8:46 ` [PATCH v5 3/3] fuse: add an implementation of open+getattr Horst Birthelmer

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=aY3Gkh8DKW_QTuTS@fedora.fritz.box \
    --to=horst@birthelmer.de \
    --cc=bschubert@ddn.com \
    --cc=hbirthelmer@ddn.com \
    --cc=horst@birthelmer.com \
    --cc=joannelkoong@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luis@igalia.com \
    --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