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: [PATCH v5 1/3] fuse: add compound command to combine multiple requests
Date: Wed, 11 Feb 2026 17:35:44 +0100 [thread overview]
Message-ID: <aYysaoP0y4_j9erG@fedora-2.fritz.box> (raw)
In-Reply-To: <CAJfpegvt0HwHOmOTzkCoOqdmvU6pf-wM228QQSauDsbcL+mmUA@mail.gmail.com>
Hi Miklos,
thanks for taking the time to look at this!
On Wed, Feb 11, 2026 at 05:13:21PM +0100, Miklos Szeredi wrote:
> On Tue, 10 Feb 2026 at 09:46, Horst Birthelmer <horst@birthelmer.com> wrote:
>
> > +static char *fuse_compound_build_one_op(struct fuse_conn *fc,
> > + struct fuse_args *op_args,
> > + char *buffer_pos)
> > +{
> > + struct fuse_in_header *hdr;
> > + size_t needed_size = sizeof(struct fuse_in_header);
> > + int j;
> > +
> > + for (j = 0; j < op_args->in_numargs; j++)
> > + needed_size += op_args->in_args[j].size;
> > +
> > + hdr = (struct fuse_in_header *)buffer_pos;
> > + memset(hdr, 0, sizeof(*hdr));
> > + hdr->len = needed_size;
> > + hdr->opcode = op_args->opcode;
> > + hdr->nodeid = op_args->nodeid;
>
> hdr->unique is notably missing.
>
> I don't know. Maybe just fill it with the index?
OK, will do. Since it was never used in libfuse, I didn't notice.
>
> > + hdr->uid = from_kuid(fc->user_ns, current_fsuid());
> > + hdr->gid = from_kgid(fc->user_ns, current_fsgid());
>
> uid/gid are not needed except for creation ops, and those need idmap
> to calculate the correct values. I don't think we want to keep legacy
> behavior of always setting these.
>
> > + hdr->pid = pid_nr_ns(task_pid(current), fc->pid_ns);
>
> This will be the same as the value in the compound header, so it's
> redundant. That might not be bad, but I feel that we're better off
> setting this to zero and letting the userspace server fetch the pid
> value from the compound header if that's needed.
>
> > +#define FUSE_MAX_COMPOUND_OPS 16 /* Maximum operations per compound */
>
> Don't see a good reason to declare this in the API. More sensible
> would be to negotiate a max_request_size during INIT.
>
Wouldn't that make for a very complicated implementation of larger compounds.
If a fuse server negotiates something like 2?
> > +
> > +#define FUSE_COMPOUND_SEPARABLE (1<<0)
> > +#define FUSE_COMPOUND_ATOMIC (1<<1)
>
> What is the meaning of these flags?
FUSE_COMPOUND_SEPARABLE is a hint for the fuse server that the requests are all
complete and there is no need to use the result of one request to complete the input
of another request further down the line.
Think of LOOKUP+MKNOD+OPEN ... that would never be 'separable'.
At the moment I use this flag to signal libfuse that it can decode the compund
and execute sequencially completely in the lib and just call the separate requests
of the fuse server.
FUSE_COMPOUND_ATOMIC was an idea to hint to the fuse server that the kernel treats
the compound as one atomic request. This can maybe save us some checks for some
compounds.
>
> > +
> > +/*
> > + * Compound request header
> > + *
> > + * This header is followed by the fuse requests
> > + */
> > +struct fuse_compound_in {
> > + uint32_t count; /* Number of operations */
>
> This is redundant, as the sum of the sub-request lengths is equal to
> the compound request length, hence calculating the number of ops is
> trivial.
>
> > + uint32_t flags; /* Compound flags */
> > +
> > + /* Total size of all results.
> > + * This is needed for preallocating the whole result for all
> > + * commands in this compound.
> > + */
> > + uint32_t result_size;
>
> I don't understand why this is needed. Preallocation by the userspace
> server? Why is this different from a simple request?
>
The reason is the implementation in libfuse.
It makes it a lot easier to know what the sum of the result buffers in the kernel is
and preallocate that in libfuse for compounds that will be decoded and handled in the
library.
> > + uint64_t reserved;
> > +};
> > +
> > +/*
> > + * Compound response header
> > + *
> > + * This header is followed by complete fuse responses
> > + */
> > +struct fuse_compound_out {
> > + uint32_t count; /* Number of results */
>
> Again, redundant.
>
> Thanks,
> Miklos
>
next prev parent reply other threads:[~2026-02-11 16: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 [this message]
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
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=aYysaoP0y4_j9erG@fedora-2.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
Powered by JetHome