diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2024-09-13 12:47:01 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2024-09-19 09:37:13 +0200 |
commit | efad7153bf93db8565128f7567aab1d23e221098 (patch) | |
tree | 9f03af4cd8c237f62d6504edc77a18fa58c71b4d /fs | |
parent | 862b9a8eb900d347af5be0eb1aeef9b161a83e77 (diff) | |
download | linux-stable-efad7153bf93db8565128f7567aab1d23e221098.tar.gz linux-stable-efad7153bf93db8565128f7567aab1d23e221098.tar.bz2 linux-stable-efad7153bf93db8565128f7567aab1d23e221098.zip |
fuse: allow O_PATH fd for FUSE_DEV_IOC_BACKING_OPEN
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.
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fuse/passthrough.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/fuse/passthrough.c b/fs/fuse/passthrough.c index 9666d13884ce..62aee8289d11 100644 --- a/fs/fuse/passthrough.c +++ b/fs/fuse/passthrough.c @@ -228,16 +228,13 @@ 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; - backing_sb = file_inode(file)->i_sb; + pr_info("%s: %x:%pD %i\n", __func__, backing_sb->s_dev, file, backing_sb->s_stack_depth); res = -ELOOP; if (backing_sb->s_stack_depth >= fc->max_stack_depth) goto out_fput; |