FILESYSTEM IN USERSPACE (FUSE) development
 help / color / mirror / Atom feed
From: Luis Henriques <luis@igalia.com>
To: Baokun Li <libaokun@linux.alibaba.com>
Cc: Bernd Schubert <bernd@bsbernd.com>,
	 fuse-devel@lists.linux.dev, miklos@szeredi.hu
Subject: Re: [PATCH 2/2] test: exercise FUSE_NOTIFY_RESEND
Date: Fri, 09 Oct 2026 14:51:48 +0100	[thread overview]
Message-ID: <87h5ivugln.fsf@igalia.com> (raw)
In-Reply-To: <e4922458-9c88-43d5-a521-d96ee7b5d0d1@linux.alibaba.com>

Hi!

On Fri, Oct 09 2026, Baokun Li wrote:

> Hi Bernd,
>
> On 2026/10/9 16:19, Bernd Schubert wrote:
>> Hi Baokun,
>>
>> On 10/9/26 09:54, Baokun Li wrote:
>>> test_notify_resend drops the first GETATTR of a file and asks the
>>> kernel to resend pending requests via fuse_lowlevel_notify_resend().
>>> The kernel redelivers the request with the FUSE_UNIQUE_RESEND bit set;
>>> the daemon detects it with fuse_req_is_resend(), answers it, and the
>>> client's stat() completes.
>> to be honest, this is one the features that I have no clue about what it
>> exists for. Why would a daemon drop requests? 
>
> The daemon does not drop them on purpose - they are lost because it
> dies with the requests in flight.  This is the failover scenario the
> feature was added for: the old daemon has already read a request from
> /dev/fuse, but panics before replying to it.
>
> Meanwhile the file descriptor of the connection is preserved - by
> another daemon, or simply by the service manager: systemd's file
> descriptor store keeps the /dev/fuse fd across a daemon restart
> (FDSTORE=1, retrieved again with sd_listen_fds()).
>
> A newly started daemon then takes the fd over and keeps serving
> new requests; the requests the old daemon had already read can be
> recovered with FUSE_NOTIFY_RESEND (760eac73f9f6, "fuse: Introduce a
> new notification type for resend pending requests").
>
>> The use-case I have in my mind is a daemon upgrade, 
>
> Yes, a daemon upgrade is indeed one of the scenarios.  It is the same
> flow as the failover case above, only planned: the old daemon hands
> the fd over to the new daemon instead of dying with it.
>
>> but that would mean that either kernel needs
>> to send a re-lookup of all inodes or that daemon needs to store lookup
>> objects (I personally see these as counter part of kernel inodes). Now,
>> besides not being implemented at all, kernel will have a hard time to
>> send re-lookup requests, unless fuse-server supports lookup by 64 bit
>> node-id.
>
> You're right that the new daemon can only answer the resent
> requests if it can still map their node IDs (and other state) to
> its own objects - that is the "daemon stores lookup objects" side
> you mention, and it is deliberately left to the daemon.
>
> FUSE_NOTIFY_RESEND does not attempt to solve state preservation -
> it only guarantees delivery of the requests that would otherwise
> be unreachable forever, no matter how much state the daemon kept.
>
>> I.e. in my personal opinion the prerequisite of FUSE_NOTIFY_RESEND is
>> missing (which could be LOOKUP_HANDLE and then using that to re-lookup
>> inodes after a daemon termination).
>
> Something like LOOKUP_HANDLE, where the kernel and the daemon pass
> file handles directly so no node ID mapping is needed, would be
> ideal.  However, I think a persistent node ID mapping on the daemon
> side would also work.
>
>> The example below also just does a simple exercise of
>> FUSE_NOTIFY_RESEND, without revealing what it would be useful for - that
>> is the part I would like to see fulfilled by an example.
>>
>
> Yes, it only checks that the API works.  It has no fd preservation
> mechanism and no persistent node ID mapping either.
>
> A full takeover setup needs the fd and state handover, which is daemon
> specific and not something a libfuse test can realistically contain,
> so I think explaining the model in the test and the commit message is
> the right scope.  Let me know if you would prefer something different.

Thank you, Baokun, for the above description (and Bernd for explicitly
CC'ing me to a patchset that I could have missed!).

I had a PR [1] created long time ago that included something similar to
your first patch in this set.  The difference was that I also tried to
solve yet another problem: setting the fd back into libfuse-specific data
structures (i.e. re-initialise libfuse itself).

This was an RFC, which later made me start looking into the LOOKUP_HANDLE.
Which is currently stale, but hopefully to resume soon.

[1] https://github.com/libfuse/libfuse/pull/1219

Cheers,
-- 
Luís

  reply	other threads:[~2026-10-09 14:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09  7:54 [PATCH 0/2] libfuse: add support for FUSE_NOTIFY_RESEND Baokun Li
2026-10-09  7:54 ` [PATCH 1/2] fuse_lowlevel: " Baokun Li
2026-10-09  7:54 ` [PATCH 2/2] test: exercise FUSE_NOTIFY_RESEND Baokun Li
2026-10-09  8:19   ` Bernd Schubert
2026-10-09  9:31     ` Baokun Li
2026-10-09 13:51       ` Luis Henriques [this message]
2026-10-10  2:33         ` Baokun Li
2026-10-13  8:32           ` Luis Henriques

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=87h5ivugln.fsf@igalia.com \
    --to=luis@igalia.com \
    --cc=bernd@bsbernd.com \
    --cc=fuse-devel@lists.linux.dev \
    --cc=libaokun@linux.alibaba.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