mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bernd Schubert <bschubert@ddn.com>
To: Horst Birthelmer <horst@birthelmer.de>,
	Bernd Schubert <bernd@bsbernd.com>
Cc: Luis Henriques <luis@igalia.com>,
	Amir Goldstein <amir73il@gmail.com>,
	Miklos Szeredi <miklos@szeredi.hu>,
	"Darrick J. Wong" <djwong@kernel.org>, Kevin Chen <kchen@ddn.com>,
	Horst Birthelmer <hbirthelmer@ddn.com>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Matt Harvey <mharvey@jumptrading.com>,
	"kernel-dev@igalia.com" <kernel-dev@igalia.com>
Subject: Re: [RFC PATCH v2 4/6] fuse: implementation of the FUSE_LOOKUP_HANDLE operation
Date: Wed, 21 Jan 2026 19:49:25 +0100	[thread overview]
Message-ID: <5d022dc0-8423-4af2-918f-81ad04d50678@ddn.com> (raw)
In-Reply-To: <aXEbnMNbE4k6WI7j@fedora>



On 1/21/26 19:36, Horst Birthelmer wrote:
> On Wed, Jan 21, 2026 at 07:28:43PM +0100, Bernd Schubert wrote:
>> On 1/21/26 19:16, Horst Birthelmer wrote:
>>> Hi Luis,
>>>
>>> On Wed, Jan 21, 2026 at 05:56:12PM +0000, Luis Henriques wrote:
>>>> Hi Horst!
>>>>
>>>> On Fri, Jan 09 2026, Horst Birthelmer wrote:
>>>>
>>>>> On Fri, Jan 09, 2026 at 07:12:41PM +0000, Bernd Schubert wrote:
>>>>>> On 1/9/26 19:29, Amir Goldstein wrote:
>>>>>>> On Fri, Jan 9, 2026 at 4:56 PM Bernd Schubert <bschubert@ddn.com> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On 1/9/26 16:37, Miklos Szeredi wrote:
>>>>>>>>> On Fri, 9 Jan 2026 at 16:03, Amir Goldstein <amir73il@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> What about FUSE_CREATE? FUSE_TMPFILE?
>>>>>>>>>
>>>>>>>>> FUSE_CREATE could be decomposed to FUSE_MKOBJ_H + FUSE_STATX + FUSE_OPEN.
>>>>>>>>>
>>>>>>>>> FUSE_TMPFILE is special, the create and open needs to be atomic.   So
>>>>>>>>> the best we can do is FUSE_TMPFILE_H + FUSE_STATX.
>>>>>>>>>
>>>>>>>
>>>>>>> I thought that the idea of FUSE_CREATE is that it is atomic_open()
>>>>>>> is it not?
>>>>>>> If we decompose that to FUSE_MKOBJ_H + FUSE_STATX + FUSE_OPEN
>>>>>>> it won't be atomic on the server, would it?
>>>>>>
>>>>>> Horst just posted the libfuse PR for compounds
>>>>>> https://github.com/libfuse/libfuse/pull/1418
>>>>>>
>>>>>> You can make it atomic on the libfuse side with the compound
>>>>>> implementation. I.e. you have the option leave it to libfuse to handle
>>>>>> compound by compound as individual requests, or you handle the compound
>>>>>> yourself as one request.
>>>>>>
>>>>>> I think we need to create an example with self handling of the compound,
>>>>>> even if it is just to ensure that we didn't miss anything in design.
>>>>>
>>>>> I actually do have an example that would be suitable.
>>>>> I could implement the LOOKUP+CREATE as a pseudo atomic operation in passthrough_hp.
>>>>
>>>> So, I've been working on getting an implementation of LOOKUP_HANDLE+STATX.
>>>> And I would like to hear your opinion on a problem I found:
>>>>
>>>> If the kernel is doing a LOOKUP, you'll send the parent directory nodeid
>>>> in the request args.  On the other hand, the nodeid for a STATX will be
>>>> the nodeid will be for the actual inode being statx'ed.
>>>>
>>>> The problem is that when merging both requests into a compound request,
>>>> you don't have the nodeid for the STATX.  I've "fixed" this by passing in
>>>> FUSE_ROOT_ID and hacking user-space to work around it: if the lookup
>>>> succeeds, we have the correct nodeid for the STATX.  That seems to work
>>>> fine for my case, where the server handles the compound request itself.
>>>> But from what I understand libfuse can also handle it as individual
>>>> requests, and in this case the server wouldn't know the right nodeid for
>>>> the STATX.
>>>>
>>>> Obviously, the same problem will need to be solved for other operations
>>>> (for example for FUSE_CREATE where we'll need to do a FUSE_MKOBJ_H +
>>>> FUSE_STATX + FUSE_OPEN).
>>>>
>>>> I guess this can eventually be fixed in libfuse, by updating the nodeid in
>>>> this case.  Another solution is to not allow these sort of operations to
>>>> be handled individually.  But maybe I'm just being dense and there's a
>>>> better solution for this.
>>>>
>>>
>>> You have come across a problem, that I have come across, too, during my experiments. 
>>> I think that makes it a rather common problem when creating compounds.
>>>
>>> This can only be solved by convention and it is the reason why I have disabled the default
>>> handling of compounds in libfuse. Bernd actually wanted to do that automatically, but I think
>>> that is too risky for exactly the reason you have found.
>>>
>>> The fuse server has to decide if it wants to handle the compound as such or as a
>>> bunch of single requests.
>>
>> Idea was actually to pass compounds to the daemon if it has a compound
>> handler, if not to handle it automatically. Now for open+getattr
>> fuse-server actually not want the additional getattr - cannot be handle
>> automatically. But for lookup+stat and others like this, if fuse server
>> server does not know how to handle the entire compound, libfuse could
>> still do it correctly, i.e. have its own handler for known compounds?
> 
> We could definitely provide a library of compounds that we 'know' in libfuse,
> of course. No argument there.
> 
> The problem Luis had was that he cannot construct the second request in the compound correctly
> since he does not have all the in parameters to write complete request.

What I mean is, the auto-handler of libfuse could complete requests of
the 2nd compound request with those of the 1st request?

> 
> BTW, I forgot in my last mail to say that we have another problem, where we need 
> some sort of convention where we will bang our heads sooner or later.
> If the fuse server does not support the given compound it should 
> return EOPNOTSUP in my opinion.
> IIRC this is not implemented correctly so far.
> 
>>
>>>
>>> At the moment I think it is best to just not use the libfuse single request handling 
>>> of the compound where it is not possible. 
>>> As my passthrough_hp shows, you can handle certain compounds as a compound where you know all the information
>>> (like some lookup, you just did in the fuse server) and leave the 'trivial' ones to the lib.
>>>
>>> We could actually pass 'one' id in the 'in header' of the compound as some sort of global parent 
>>> but that would be another convention that the fuse server has to know and keep.
>>>
>>
>>
>> Thanks,
>> Bernd
> 
> Horst


  reply	other threads:[~2026-01-21 18:49 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-12 18:12 [RFC PATCH v2 0/6] fuse: LOOKUP_HANDLE operation Luis Henriques
2025-12-12 18:12 ` [RFC PATCH v2 1/6] fuse: store index of the variable length argument Luis Henriques
2025-12-12 18:12 ` [RFC PATCH v2 2/6] fuse: move fuse_entry_out structs out of the stack Luis Henriques
2025-12-15 14:03   ` Bernd Schubert
2025-12-16 10:30     ` Luis Henriques
2025-12-12 18:12 ` [RFC PATCH v2 3/6] fuse: initial infrastructure for FUSE_LOOKUP_HANDLE support Luis Henriques
2025-12-15 13:36   ` Bernd Schubert
2025-12-15 17:06     ` Amir Goldstein
2025-12-15 17:11       ` Bernd Schubert
2025-12-15 18:09         ` Amir Goldstein
2025-12-15 18:23           ` Bernd Schubert
2025-12-16 10:36           ` Luis Henriques
2025-12-16 10:19   ` Miklos Szeredi
2025-12-16 11:33     ` Luis Henriques
2025-12-16 11:46       ` Miklos Szeredi
2025-12-16 12:02         ` Luis Henriques
2025-12-12 18:12 ` [RFC PATCH v2 4/6] fuse: implementation of the FUSE_LOOKUP_HANDLE operation Luis Henriques
2025-12-15 17:39   ` Bernd Schubert
2025-12-16 11:48     ` Luis Henriques
2025-12-17 10:18       ` Amir Goldstein
2025-12-17 14:45         ` Luis Henriques
2025-12-17 15:02       ` Bernd Schubert
2025-12-17 16:53         ` Luis Henriques
2025-12-16  8:49   ` Joanne Koong
2025-12-16  8:54     ` Bernd Schubert
2025-12-17  0:32       ` Joanne Koong
2025-12-17  1:00         ` Darrick J. Wong
2025-12-17  2:48           ` Joanne Koong
2025-12-17  9:38             ` Luis Henriques
2025-12-17 10:08               ` Miklos Szeredi
2025-12-17 16:17                 ` Luis Henriques
2025-12-16 10:39   ` Miklos Szeredi
2025-12-16 10:51     ` Amir Goldstein
2025-12-16 11:07       ` Miklos Szeredi
2026-01-09 11:57     ` Luis Henriques
2026-01-09 12:38       ` Miklos Szeredi
2026-01-09 14:45         ` Luis Henriques
2026-01-09 14:56           ` Horst Birthelmer
2026-01-09 17:07             ` Luis Henriques
2026-01-12  7:43               ` Horst Birthelmer
2026-01-09 15:20           ` Miklos Szeredi
2026-01-09 15:03         ` Amir Goldstein
2026-01-09 15:37           ` Miklos Szeredi
2026-01-09 15:56             ` Bernd Schubert
2026-01-09 16:28               ` Miklos Szeredi
2026-01-09 17:16                 ` Luis Henriques
2026-01-09 18:29               ` Amir Goldstein
2026-01-09 19:01                 ` Miklos Szeredi
2026-01-09 19:28                   ` Amir Goldstein
2026-01-09 19:12                 ` Bernd Schubert
2026-01-09 19:55                   ` Horst Birthelmer
2026-01-21 17:56                     ` Luis Henriques
2026-01-21 18:16                       ` Horst Birthelmer
2026-01-21 18:28                         ` Bernd Schubert
2026-01-21 18:36                           ` Horst Birthelmer
2026-01-21 18:49                             ` Bernd Schubert [this message]
2026-01-21 19:00                               ` Horst Birthelmer
2026-01-21 19:03                                 ` Bernd Schubert
2026-01-21 19:12                                   ` Horst Birthelmer
2026-01-22  9:52                                     ` Luis Henriques
2026-01-22 10:20                                       ` Horst Birthelmer
2026-01-22 10:35                                         ` Bernd Schubert
2026-01-22 10:53                                         ` Luis Henriques
2026-01-22 10:59                                           ` Horst Birthelmer
2026-01-22 11:25                                             ` Luis Henriques
2026-01-22 11:32                                               ` Bernd Schubert
2026-01-22 12:34                                               ` Horst Birthelmer
2025-12-12 18:12 ` [RFC PATCH v2 5/6] fuse: factor out NFS export related code Luis Henriques
2025-12-14 15:13   ` Amir Goldstein
2025-12-15 12:05     ` Luis Henriques
2025-12-12 18:12 ` [RFC PATCH v2 6/6] fuse: implementation of export_operations with FUSE_LOOKUP_HANDLE Luis Henriques
2025-12-16 10:58   ` Miklos Szeredi
2025-12-16 17:06     ` Luis Henriques
2025-12-16 20:12       ` Horst Birthelmer
2025-12-17 17:02         ` Luis Henriques
2025-12-17 18:02           ` Horst Birthelmer
2025-12-16 11:01   ` Amir Goldstein
2025-12-16 17:26     ` Luis Henriques
2025-12-14 17:02 ` [RFC PATCH v2 0/6] fuse: LOOKUP_HANDLE operation Askar Safin
2025-12-15 12:08   ` Luis Henriques
2025-12-16  0:33     ` Askar Safin
2025-12-16 17:36       ` Luis Henriques
2025-12-16 18:49       ` Bernd Schubert
2025-12-16 22:45         ` Askar Safin
2025-12-25  7:42         ` Askar Safin
2026-01-04 22:38         ` Askar Safin

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=5d022dc0-8423-4af2-918f-81ad04d50678@ddn.com \
    --to=bschubert@ddn.com \
    --cc=amir73il@gmail.com \
    --cc=bernd@bsbernd.com \
    --cc=djwong@kernel.org \
    --cc=hbirthelmer@ddn.com \
    --cc=horst@birthelmer.de \
    --cc=kchen@ddn.com \
    --cc=kernel-dev@igalia.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luis@igalia.com \
    --cc=mharvey@jumptrading.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

all inboxes | Powered by JetHome®