On Fri, Apr 5, 2024 at 11:52 PM Sweet Tea Dorminy <sweettea-kernel@xxxxxxxxxx> wrote: > > > > Sweet Tea, > > > > Can you please explain the workload where you find that this patch is needed? > > I was researching before sending out my own version of attr passthrough > - it seemed like a step in the direction, but then the code in-tree > wasn't the same. > FYI, I have pushed a WIP branch with some patches in the general direction of getattr() passthrough: https://github.com/amir73il/linux/commits/fuse-backing-inode-wip/ It is not at all functional and probably not working - I only verified that it does not explode when I run xfstests, but passthrough_hp does not yet have an API to enable getattr() passthrough. I am posting this branch here so that we can compare notes and so that you can learn it before we meet in LSFMM. I wanted to give some ideas for API and implementation. the main thing I added is the ability to declare the passthrough ops in a mask with the backing file setup: --- a/include/uapi/linux/fuse.h +++ b/include/uapi/linux/fuse.h @@ -1076,9 +1076,21 @@ struct fuse_notify_retrieve_in { struct fuse_backing_map { int32_t fd; uint32_t flags; - uint64_t padding; + uint64_t ops_mask; }; +#define FUSE_PASSTHROUGH_OP(op) (1ULL << ((op) - 1)) + +/* These passthrough operations are implied by FOPEN_PASSTHROUGH */ +#define FUSE_PASSTHROUGH_RW_OPS \ + (FUSE_PASSTHROUGH_OP(FUSE_READ) | FUSE_PASSTHROUGH_OP(FUSE_WRITE)) + +#define FUSE_BACKING_MAP_OP(map, op) \ + ((map)->ops_mask & FUSE_PASSTHROUGH_OP(op)) + +#define FUSE_BACKING_MAP_VALID_OPS \ + (FUSE_PASSTHROUGH_RW_OPS) + Which is later extended to support also + /* Inode passthrough operations for backing file attached on lookup */ + #define FUSE_PASSTHROUGH_INODE_OPS \ + (FUSE_PASSTHROUGH_OP(FUSE_GETATTR) | \ + FUSE_PASSTHROUGH_OP(FUSE_GETXATTR) | \ + FUSE_PASSTHROUGH_OP(FUSE_LISTXATTR) | \ + FUSE_PASSTHROUGH_OP(FUSE_STATX)) The idea is that these would be setup during FUSE_LOOKUP response. Let me know what you think. Thanks, Amir.