public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joanne Koong <joannelkoong@gmail.com>
To: Paul Lawrence <paullawrence@google.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	linux-kernel@vger.kernel.org,  linux-fsdevel@vger.kernel.org,
	kernel-team@meta.com
Subject: Re: [PATCH v1 0/2] RFC: Extend fuse-passthrough to directories
Date: Wed, 18 Mar 2026 11:12:56 -0700	[thread overview]
Message-ID: <CAJnrk1YWd9HvVLTtZDEM=XyOaPvkuSF8O5uOu9k=m=tUREsw-A@mail.gmail.com> (raw)
In-Reply-To: <20250617221456.888231-1-paullawrence@google.com>

On Tue, Jun 17, 2025 at 3:15 PM Paul Lawrence <paullawrence@google.com> wrote:
>
> This is the first part of a much larger patch set that would allow a directory
> to be marked ‘passthrough’. At a high level, the fuse daemon can return an
> optional extra argument to FUSE_LOOKUP that contains an fd. Extra fields are
> added to the fuse_dentry, fuse_inode and fuse_file structs to have a backing
> path, inode and file respectively. When fuse is performing an operation, it will
> check for the existence of a backing object and if it exists forward the
> operation to the backing object.
>
> These two patches add the core infrastructure, handling of the extra argument
> response to lookup, and forwarding open, flush and close to the backing file.
> This is sufficient to validate the concept.
>
> The questions I have:
>
> * Is this something that interests the fuse maintainers and community?
> * Is this approach the correct one?
> * (if we agree yes to 1 & 2) Detailed analysis of the patches for errors.
>
> A few observations:
>
> I have matched backing objects to their fuse objects. Currently fuse passthrough
> puts a backing file into the fuse inode. I’m not quite sure why this was done -
> it seems to have been a very late change in the passthrough patch sets which
> happened without comment. It does not really make sense for full directory
> passthrough since unopened inodes still need to have backing inodes. The one
> advantage I can see is that it reduces the number of opens/closes of the backing
> file. However, this may also be a disadvantage - it moves closes, in particular,
> to an arbitrary point when the inode is flushed from cache.
>
> Backing operations need to happen in the context of the daemon, not the caller.
> (I am a firm believer of this principle.) This is not yet implemented, and is
> not (currently, and unfortunately) the way Android uses passthough. It is not
> hard to do, and if these patches are otherwise acceptable, will be added.
>
> There was a long discussion about the security issues of using an fd returned
> from the fuse daemon in the context of fuse passthrough, and the end solution
> was to use an ioctl to set the backing file. I have used the previously-rejected
> approach of passing the fd in a struct in the fuse_daemon response. My defense
> of this approach is
>
> * The fd is simply used to pull out the path and inode
> * All operations are revalidated
> * Thus there is no risk even if a privileged process with a protected fd is
> tricked into passing that fd back in this structure.
>
> I’m sure we will discuss this at length if this patch set is otherwise deemed
> valuable, and I am certainly not wedded to this approach.
>
> I have written tests to validate this approach using tools/testing/selftests. I
> don’t want this patch set to get derailed by a discussion of the way I wrote the
> tests, so I have not included them. I am very open to any and every suggestion
> as to how (and where) tests should be written for these patches.
>
> Paul Lawrence (2):
>   fuse: Add backing file option to lookup
>   fuse: open/close backing file
>
>  fs/fuse/Kconfig           |  13 +++++
>  fs/fuse/Makefile          |   1 +
>  fs/fuse/backing.c         |  97 ++++++++++++++++++++++++++++++++
>  fs/fuse/dev.c             |  14 +++++
>  fs/fuse/dir.c             | 108 +++++++++++++++++++++++++-----------
>  fs/fuse/file.c            |  34 ++++++++----
>  fs/fuse/fuse_i.h          |  61 +++++++++++++++++++-
>  fs/fuse/inode.c           | 114 ++++++++++++++++++++++++++++++++++----
>  include/uapi/linux/fuse.h |   4 ++
>  9 files changed, 392 insertions(+), 54 deletions(-)
>  create mode 100644 fs/fuse/backing.c
>

Hi Paul,

Are you still planning to continue work on this series? We have some
internal users at Meta who need this feature. I'm happy to pick this
up if you're no longer working on it, or collaborate if you'd prefer.

Thanks,
Joanne
> --
> 2.49.0.1112.g889b7c5bd8-goog
>
>

  parent reply	other threads:[~2026-03-18 18:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-17 22:14 [PATCH v1 0/2] RFC: Extend fuse-passthrough to directories Paul Lawrence
2025-06-17 22:14 ` [PATCH v1 1/2] fuse: Add backing file option to lookup Paul Lawrence
2025-06-18 13:46   ` kernel test robot
2025-06-17 22:14 ` [PATCH v1 2/2] fuse: open/close backing file Paul Lawrence
2025-06-18 11:01 ` [PATCH v1 0/2] RFC: Extend fuse-passthrough to directories Amir Goldstein
2025-06-19 19:50   ` Paul Lawrence
2025-06-19 20:29     ` Amir Goldstein
2025-07-14 15:20       ` Amir Goldstein
2025-07-22 21:13         ` Paul Lawrence
2025-07-23 16:53           ` Amir Goldstein
2025-07-23 18:30             ` Paul Lawrence
2025-07-24 19:51               ` Amir Goldstein
2025-08-04 17:32                 ` [PATCH 0/2] RFC: Set backing file at lookup Paul Lawrence
2025-08-04 17:32                   ` [PATCH 1/2] fuse: Allow backing file to be set at lookup (WIP) Paul Lawrence
2025-08-10 14:21                     ` Amir Goldstein
2025-08-04 17:32                   ` [PATCH 2/2] fuse: Add passthrough for mkdir and rmdir (WIP) Paul Lawrence
2025-08-10 15:40                     ` Amir Goldstein
2025-08-10 13:25                   ` [PATCH 0/2] RFC: Set backing file at lookup Amir Goldstein
2025-08-10 14:32                     ` Amir Goldstein
2026-03-18 18:12 ` Joanne Koong [this message]
2026-03-23 17:08   ` [PATCH v1 0/2] RFC: Extend fuse-passthrough to directories Paul Lawrence
2026-03-23 22:24     ` Joanne Koong

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='CAJnrk1YWd9HvVLTtZDEM=XyOaPvkuSF8O5uOu9k=m=tUREsw-A@mail.gmail.com' \
    --to=joannelkoong@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=paullawrence@google.com \
    /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