On Fri, Sep 13, 2024 at 12:50 PM Miklos Szeredi <mszeredi@xxxxxxxxxx> wrote: > > Only f_path is used from backing files registered with > FUSE_DEV_IOC_BACKING_OPEN, so it makes sense to allow O_PATH descriptors. > > O_PATH files have an empty f_op, so don't check read_iter/write_iter. > > Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxxxxx> Agreed. Reviewed-by: Amir Goldstein <amir73il@xxxxxxxxx> > --- > fs/fuse/passthrough.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/fs/fuse/passthrough.c b/fs/fuse/passthrough.c > index 9666d13884ce..ba3207f6c4ce 100644 > --- a/fs/fuse/passthrough.c > +++ b/fs/fuse/passthrough.c > @@ -228,15 +228,11 @@ int fuse_backing_open(struct fuse_conn *fc, struct fuse_backing_map *map) > if (map->flags || map->padding) > goto out; > > - file = fget(map->fd); > + file = fget_raw(map->fd); > res = -EBADF; > if (!file) > goto out; > > - res = -EOPNOTSUPP; > - if (!file->f_op->read_iter || !file->f_op->write_iter) > - goto out_fput; > - FWIW, I have made those sanity checks opt-in in my fuse-backing-inode-wip branch: https://github.com/amir73il/linux/commit/24c9a87bb11d76414b85960c0e3638a655a9c9a1 But that could be added later. Thanks, Amir.