[PATCH 0/2] RFC: Set backing file at lookup

Paul Lawrence posted 2 patches 2 months ago
fs/fuse/dir.c             | 31 +++++++++++++---
fs/fuse/fuse_i.h          | 14 ++++++-
fs/fuse/iomode.c          | 41 ++++++++++++++++++--
fs/fuse/passthrough.c     | 78 ++++++++++++++++++++++++++++++++++-----
include/uapi/linux/fuse.h |  6 +++
5 files changed, 150 insertions(+), 20 deletions(-)
[PATCH 0/2] RFC: Set backing file at lookup
Posted by Paul Lawrence 2 months ago
Based on our discussion, I put together two simple patches.

The first adds an optional extra parameter to FUSE_LOOKUP outargs. This allows
the daemon to set a backing file at lookup time on a successful lookup.

I then looked at which opcodes do not require a file handle. The simplest seem
to be FUSE_MKDIR and FUSE_RMDIR. So I implemented passthrough handling for these
opcodes in the second patch.

Both patches sit on top of Amir's tree at:

https://github.com/amir73il/linux/commit/ceaf7f16452f6aaf7993279b1c10e727d6bf6a32

Thoughts?

Paul

Paul Lawrence (2):
  fuse: Allow backing file to be set at lookup (WIP)
  fuse: Add passthrough for mkdir and rmdir (WIP)

 fs/fuse/dir.c             | 31 +++++++++++++---
 fs/fuse/fuse_i.h          | 14 ++++++-
 fs/fuse/iomode.c          | 41 ++++++++++++++++++--
 fs/fuse/passthrough.c     | 78 ++++++++++++++++++++++++++++++++++-----
 include/uapi/linux/fuse.h |  6 +++
 5 files changed, 150 insertions(+), 20 deletions(-)

-- 
2.50.1.565.gc32cd1483b-goog
Re: [PATCH 0/2] RFC: Set backing file at lookup
Posted by Amir Goldstein 1 month, 3 weeks ago
On Mon, Aug 4, 2025 at 7:32 PM Paul Lawrence <paullawrence@google.com> wrote:
>
> Based on our discussion, I put together two simple patches.
>
> The first adds an optional extra parameter to FUSE_LOOKUP outargs. This allows
> the daemon to set a backing file at lookup time on a successful lookup.
>
> I then looked at which opcodes do not require a file handle. The simplest seem
> to be FUSE_MKDIR and FUSE_RMDIR. So I implemented passthrough handling for these
> opcodes in the second patch.
>
> Both patches sit on top of Amir's tree at:
>
> https://github.com/amir73il/linux/commit/ceaf7f16452f6aaf7993279b1c10e727d6bf6a32
>

I think you based your patches on ceaf7f16452f^ and patch 1/2 replaces commit
ceaf7f16452f ("fuse: support setting backing inode passthrough on getattr")

Right?

That makes sense to me because that last patch was a hacky API,
but then you made some other changes to my patch which I did not understand why.

Thanks,
Amir.
Re: [PATCH 0/2] RFC: Set backing file at lookup
Posted by Amir Goldstein 1 month, 3 weeks ago
On Sun, Aug 10, 2025 at 3:25 PM Amir Goldstein <amir73il@gmail.com> wrote:
>
> On Mon, Aug 4, 2025 at 7:32 PM Paul Lawrence <paullawrence@google.com> wrote:
> >
> > Based on our discussion, I put together two simple patches.
> >
> > The first adds an optional extra parameter to FUSE_LOOKUP outargs. This allows
> > the daemon to set a backing file at lookup time on a successful lookup.
> >
> > I then looked at which opcodes do not require a file handle. The simplest seem
> > to be FUSE_MKDIR and FUSE_RMDIR. So I implemented passthrough handling for these
> > opcodes in the second patch.
> >
> > Both patches sit on top of Amir's tree at:
> >
> > https://github.com/amir73il/linux/commit/ceaf7f16452f6aaf7993279b1c10e727d6bf6a32
> >
>
> I think you based your patches on ceaf7f16452f^ and patch 1/2 replaces commit
> ceaf7f16452f ("fuse: support setting backing inode passthrough on getattr")
>
> Right?
>
> That makes sense to me because that last patch was a hacky API,
> but then you made some other changes to my patch which I did not understand why.

Push a new version of fuse-backing-inode-wip based on
https://github.com/amir73il/libfuse/commits/fuse_passthrough_iops/

Please base your work on the above branch with the helpers instead of
modifying them.

Thanks,
Amir.