mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 13:03:25 +01:00
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>
This commit is contained in:
parent
862b9a8eb9
commit
efad7153bf
1 changed files with 2 additions and 5 deletions
|
@ -228,16 +228,13 @@ int fuse_backing_open(struct fuse_conn *fc, struct fuse_backing_map *map)
|
||||||
if (map->flags || map->padding)
|
if (map->flags || map->padding)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
file = fget(map->fd);
|
file = fget_raw(map->fd);
|
||||||
res = -EBADF;
|
res = -EBADF;
|
||||||
if (!file)
|
if (!file)
|
||||||
goto out;
|
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;
|
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;
|
res = -ELOOP;
|
||||||
if (backing_sb->s_stack_depth >= fc->max_stack_depth)
|
if (backing_sb->s_stack_depth >= fc->max_stack_depth)
|
||||||
goto out_fput;
|
goto out_fput;
|
||||||
|
|
Loading…
Reference in a new issue