On Fri, May 19, 2023 at 3:57 PM Amir Goldstein <amir73il@xxxxxxxxx> wrote: > > Miklos, > > This patch set addresses your review feedback on Alesio's V12 patch set > from 2021 [1] as well as other bugs that I have found since. > This patch set uses refcounted backing files as we discussed recently [2]. > > I am posting this for several possible outcomes: > > 1. Either FUSE-BPF develpers can use this as a reference implementation > for their 1st phase of "backing file passthrough" > 2. Or they can tell me which API changes need to made to this patch set > so the API is flexible enough to extend to "backing inode passthrough" > and to "BPF filters" later on > 3. We find there is little overlap in the APIs and merge this as is > > These patches are available on github [3] along with libfuse patches [4]. > I tested them by running xfstests (./check -fuse -g quick.rw) with latest > libfuse xfstest support. > > Without FOPEN_PASSTHROUGH, one test in this group fails (generic/451) > which tests mixed buffered/aio writes. > With FOPEN_PASSTHROUGH, this test also passes. > > This revision does not set any limitations on the number of backing files > that can be mapped by the server. I considered several ways to address > this and decided to try a different approach. > > Patch 10 (with matching libfuse patch) is an RFC patch for an alternative > API approach. Please see my comments on that patch. > > Thanks, > Amir. > > [1] https://lore.kernel.org/linux-fsdevel/20210125153057.3623715-1-balsini@xxxxxxxxxxx/ > [2] https://lore.kernel.org/linux-fsdevel/CAJfpegvbMKadnsBZmEvZpCxeWaMEGDRiDBqEZqaBSXcWyPZnpA@xxxxxxxxxxxxxx/ > [3] https://github.com/amir73il/linux/commits/fuse-passthrough-fd > [4] https://github.com/amir73il/libfuse/commits/fuse-passthrough-fd > > Changes since v12: > - Rebase to v6.4-rc2 > - Reword 'lower file' language to 'backing file' > - Add explicit FOPEN_PASSTHROUGH open flags > - Remove fuse_passthrough_out container > - Add FUSE_DEV_IOC_PASSTHROUGH_CLOSE ioctl > - Add experimental FUSE_DEV_IOC_PASSTHROUGH_SETUP ioctl > - Distinguished errors for failures to create passthrough id > (EBADF, EOPNOTSUPP, ELOOP) > - idr and fuse_file point to refcounted passthrough object > - Use rcu_read_lock() to get passthrough object by id > - Handle errors to setup passthrough in atomic_open() > - Invalidate mtime/size after passthrough write > - Invalidate atime after passthrough read/mmap > - Bump FUSE protocol minor version > Alessio Balsini (2): > fs: Generic function to convert iocb to rw flags > fuse: Definitions and ioctl for passthrough > > Amir Goldstein (8): > fuse: Passthrough initialization and release > fuse: Introduce synchronous read and write for passthrough > fuse: Handle asynchronous read and write in passthrough > fuse: Use daemon creds in passthrough mode > fuse: Introduce passthrough for mmap > fuse: update inode size/mtime after passthrough write > fuse: invalidate atime after passthrough read/mmap > fuse: setup a passthrough fd without a permanent backing id > Hi Alessio et al. FYI, the authorship of the patches in this set have been randomly reset by git rebase. I've restored Alessio's authorship on my branch for patches 4-7 which I have changed only mildly. OTOH, I have taken over authorship on patches 2-3 which I had made more significant changes to (i.e. refcounted backing files). Also, please note my comment on patch 2 for copyright notice on the new passthrough.c file. Thanks, Amir.