Skip to content

fuse: extend passthrough to inode operations

Joanne Koong fuse-devel linux-unionfs 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest21 patches 37 repliesIn review
  2. v117 patches 38 repliesSuperseded

Changes in v2 from the cover letter

- Address Amir's feedback (especially about not mixing cached io mode with
passthrough mode, dropping the passthrough open patch, modeling some of the
logic after overlayfs)
- Diff between v2 and v1 for Amir's patches 1-7:
https://gist.github.com/joannekoong/451eb02e716fa6321a622a61a95aea04

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21fuse: introduce FUSE_PASSTHROUGH_INO modefs/fuse/file.c fs/fuse/fuse_i.h fs/fuse/inode.c +2 more+27 -90 replies
2/21fuse: prepare for passthrough of inode operationsfs/fuse/backing.c fs/fuse/fuse_i.h fs/fuse/iomode.c +1 more+64 -45 replies
3/21fuse: prepare for readdir passthrough on directoriesfs/fuse/cuse.c fs/fuse/dir.c fs/fuse/file.c +3 more+37 -280 replies
4/21fuse: implement passthrough for readdirfs/fuse/backing.c fs/fuse/dir.c fs/fuse/file.c +5 more+67 -40 replies
5/21fuse: prepare for long lived reference on backing filefs/fuse/file.c fs/fuse/fuse_i.h fs/fuse/inode.c +1 more+22 -70 replies
6/21fuse: implement passthrough for getattr/statxfs/fuse/dir.c fs/fuse/fuse_i.h fs/fuse/passthrough.c +1 more+76 -11 reply
7/21fuse: prepare to setup backing inode passthrough on lookupfs/fuse/backing.c fs/fuse/fuse_i.h fs/fuse/iomode.c +1 more+72 -210 replies
8/21fuse: handle zero ops_mask in FUSE_DEV_IOC_BACKING_OPENfs/fuse/backing.c+17 -31 reply
9/21fuse: handle partial io passthrough for read/write, splice, and mmapfs/fuse/file.c fs/fuse/fuse_i.h fs/fuse/passthrough.c+25 -33 replies
10/21fuse: prepare to cache statx attributes from entry repliesfs/fuse/dir.c fs/fuse/fuse_i.h fs/fuse/inode.c +1 more+13 -140 replies
11/21fuse: clean up fuse_dentry_revalidate()fs/fuse/dir.c+52 -600 replies
12/21fuse: add struct fuse_entry2_out and helpers for extended entry repliesfs/fuse/dir.c fs/fuse/fuse_i.h include/uapi/linux/fuse.h+107 -286 replies
13/21fuse: add passthrough lookupfs/fuse/dir.c+52 -141 reply
14/21fuse: add passthrough support for entry creationfs/fuse/dir.c+28 -40 replies
15/21fuse: add passthrough support for create+openfs/fuse/dir.c+35 -80 replies
16/21fuse: allow backing_id=0 in open to inherit inode's backing filefs/fuse/passthrough.c+5 -11 reply
17/21backing-inode: add backing_inode_copyattr()fs/Makefile fs/backing-inode.c fs/overlayfs/util.c +1 more+61 -313 replies
18/21backing-inode: add backing_inode_setattr()fs/backing-inode.c fs/overlayfs/inode.c include/linux/backing-inode.h+76 -481 reply
19/21fuse: add passthrough setattrfs/fuse/dir.c fs/fuse/fuse_i.h fs/fuse/passthrough.c +1 more+34 -14 replies
20/21fuse: use passthrough getattr in setattr suid/sgid handlingfs/fuse/dir.c+5 -13 replies
21/21docs: fuse: document extended passthrough (FUSE_PASSTHROUGH_INO)Documentation/filesystems/fuse/fuse-passthrough.rst+126 -03 replies

Reviews trailers per patch

14 of 21 patches have a Reviewed-by or Acked-by.

PatchJoanne KoongAmir Goldstein
1/21R-b
2/21R-b
3/21R-b
4/21R-b
5/21R-b
6/21R-b
7/21R-b
8/21R-b
9/21
10/21R-b
11/21R-b
12/21
13/21
14/21
15/21
16/21R-b
17/21R-b
18/21R-b
19/21R-b
20/21
21/21

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/21] fuse: extend passthrough to inode operations

This series extends fuse passthrough to support inode operations (getattr + setattr) and directory readdir.

The existing FUSE_PASSTHROUGH mode attaches a backing file to a fuse inode only when a passthrough file is open. This series introduces FUSE_PASSTHROUGH_INO, a stricter mode requiring one-to-one inode number mapping, which allows attaching a backing file for the lifetime of the fuse inode.

This is based off Amir's work. Patches 1-7 are from his git tree in [1].

For testing/debugging, this was done using the passthrough_hp server with the changes in [2] applied.

This series was run through fstests using passthrough_hp in [2]. There were no regressions seen compared to passthrough_hp --nopassthrough and an improvement in generic 683, 684, and 685 (dropping suid/sgid) now passing. Compared to passthrough_hp without inode operations passed through, generic tests 080 and 215 (mapped write timestamp updates) now pass.

This is on top of commit ea2ff881bb8e ("fuse: reduce attributes invalidated on directory change") + a locally applied patch [3], in Miklos's fuse tree.

[1] https://github.com/amir73il/linux/commits/fuse-backing-inode-wip/
[2] https://github.com/joannekoong/libfuse/commits/extended_passthrough_v2/
[3] https://lore.kernel.org/fuse-devel/[email protected]/T/#u

Changelog
---------
v1: https://lore.kernel.org/fuse-devel/CAOQ4uxjBZL6CY0mJEiHrw8aR28MHg5pU+Pfr9fUqGdKPDOdwcw@mail.gmail.com/T/
v1 -> v2:
- Address Amir's feedback (especially about not mixing cached io mode with
passthrough mode, dropping the passthrough open patch, modeling some of the
logic after overlayfs)
- Diff between v2 and v1 for Amir's patches 1-7:
https://gist.github.com/joannekoong/451eb02e716fa6321a622a61a95aea04

Amir Goldstein (7):
fuse: introduce FUSE_PASSTHROUGH_INO mode
fuse: prepare for passthrough of inode operations
fuse: prepare for readdir passthrough on directories
fuse: implement passthrough for readdir
fuse: prepare for long lived reference on backing file
fuse: implement passthrough for getattr/statx
fuse: prepare to setup backing inode passthrough on lookup

Joanne Koong (14):
fuse: handle zero ops_mask in FUSE_DEV_IOC_BACKING_OPEN
fuse: handle partial io passthrough for read/write, splice, and mmap
fuse: prepare to cache statx attributes from entry replies
fuse: clean up fuse_dentry_revalidate()
fuse: add struct fuse_entry2_out and helpers for extended entry
replies
fuse: add passthrough lookup
fuse: add passthrough support for entry creation
fuse: add passthrough support for create+open
fuse: allow backing_id=0 in open to inherit inode's backing file
backing-inode: add backing_inode_copyattr()
backing-inode: add backing_inode_setattr()
fuse: add passthrough setattr
fuse: use passthrough getattr in setattr suid/sgid handling
docs: fuse: document extended passthrough (FUSE_PASSTHROUGH_INO)

 .../filesystems/fuse/fuse-passthrough.rst     | 126 ++++++
 fs/Makefile                                   |   2 +-
 fs/backing-inode.c                            |  97 +++++
 fs/fuse/backing.c                             |  64 ++-
 fs/fuse/cuse.c                                |   2 +-
 fs/fuse/dir.c                                 | 391 +++++++++++++-----
 fs/fuse/file.c                                |  37 +-
 fs/fuse/fuse_i.h                              |  83 +++-
 fs/fuse/inode.c                               |  27 +-
 fs/fuse/iomode.c                              | 122 +++++-
 fs/fuse/passthrough.c                         | 122 +++++-
 fs/fuse/readdir.c                             |   5 +-
 fs/overlayfs/inode.c                          |  66 +--
 fs/overlayfs/util.c                           |  33 +-
 include/linux/backing-inode.h                 |  18 +
 include/uapi/linux/fuse.h                     |  32 +-
 16 files changed, 969 insertions(+), 258 deletions(-)
 create mode 100644 fs/backing-inode.c
 create mode 100644 include/linux/backing-inode.h
Signature · 1 line
2.52.0