From: Amir Goldstein <amir73il@gmail.com>
To: Chunsheng Luo <luochunsheng@ustc.edu>
Cc: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC 0/2] fuse/passthrough: simplify daemon crash recovery
Date: Thu, 15 Jan 2026 16:43:01 +0100 [thread overview]
Message-ID: <aWkLBXv4AO5QMmPf@amir-ThinkPad-T480> (raw)
In-Reply-To: <20260115072032.402-1-luochunsheng@ustc.edu>
On Thu, Jan 15, 2026 at 03:20:29PM +0800, Chunsheng Luo wrote:
> To simplify FUSE daemon crash recovery and reduce performance overhead,
> passthrough backing_id information is not persisted. However, this
> approach introduces two challenges after daemon restart:
>
> 1. Non-persistent backing_ids prevent proper resource cleanup, leading
> to resource leaks.
> 2. New backing_ids allocated for the same FUSE file cause -EIO errors
> due to strict fuse_backing validation in
> fuse_inode_uncached_io_start(), even when accessing the same
> backing file. This persists until all previously opened files are
> closed.
>
> There are common scenarios where reusing the cached fuse_inode->fb is
> safe:
>
> Scenario 1: The same backing file (with identical inode) is
> re-registered after recovery.
> Scenario 2: In a read-only FUSE filesystem, the backing file may be
> cleaned up and re-downloaded (resulting in a different
> inode, but identical content).
That is just not acceptable by design, regardless of server restart.
fuse passthrough may be configured per individual file open, but
all fd referring to the same fuse inode need to passthrough to the
same backing inode.
If your server want to serve different fd of same fuse inode from
different backing files (no matter if they claim to have the same content),
server needs to do that with FOPEN_DIRECT_IO, it cannot do that with
FOPEN_PASSTHROUGH.
Thanks,
Amir.
>
> Proposed Solution:
>
> 1. Enhance fuse_dev_ioctl_backing_close() to support closing all
> backing_ids at once, enabling comprehensive resource cleanup after
> restart.
>
> 2. Introduce the FOPEN_PASSTHROUGH_INODE_CACHE flag. When set during
> fuse_open(), the kernel prioritizes reusing the existing
> fuse_backing cached in fuse_inode, falling back to the
> backing_id-associated fb only if the cache is empty.
>
> I'd appreciate any feedback on whether there are better approaches or
> potential improvements to this solution.
>
> Thanks.
> ---
> Chunsheng Luo (2):
> fuse: add close all in passthrough backing close for crash recovery
> fuse: Add new flag to reuse the backing file of fuse_inode
>
> fs/fuse/backing.c | 14 ++++++++++++++
> fs/fuse/dev.c | 5 +++++
> fs/fuse/fuse_i.h | 1 +
> fs/fuse/iomode.c | 2 +-
> fs/fuse/passthrough.c | 11 +++++++++++
> include/uapi/linux/fuse.h | 2 ++
> 6 files changed, 34 insertions(+), 1 deletion(-)
>
> --
> 2.43.0
>
next prev parent reply other threads:[~2026-01-15 15:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-15 7:20 Chunsheng Luo
2026-01-15 7:20 ` [RFC 1/2] fuse: add close all in passthrough backing close for " Chunsheng Luo
2026-01-15 12:23 ` Amir Goldstein
2026-01-15 13:30 ` Chunsheng Luo
2026-01-15 7:20 ` [RFC 2/2] fuse: Add new flag to reuse the backing file of fuse_inode Chunsheng Luo
2026-01-15 13:09 ` Amir Goldstein
2026-01-15 14:34 ` Chunsheng Luo
2026-01-15 15:31 ` Amir Goldstein
2026-01-16 2:43 ` Chunsheng Luo
2026-01-16 19:08 ` Amir Goldstein
2026-01-17 15:26 ` Chunsheng Luo
2026-01-15 15:43 ` Amir Goldstein [this message]
2026-01-16 1:57 ` [RFC 0/2] fuse/passthrough: simplify daemon crash recovery Chunsheng Luo
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=aWkLBXv4AO5QMmPf@amir-ThinkPad-T480 \
--to=amir73il@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luochunsheng@ustc.edu \
--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®