1
0
Fork 0
alistair23-linux/fs/fuse
Miklos Szeredi 7df1e988c7 fuse: fix fuse_send_readpages() in the syncronous read case
Buffered read in fuse normally goes via:

 -> generic_file_buffered_read()
   -> fuse_readpages()
     -> fuse_send_readpages()
       ->fuse_simple_request() [called since v5.4]

In the case of a read request, fuse_simple_request() will return a
non-negative bytecount on success or a negative error value.  A positive
bytecount was taken to be an error and the PG_error flag set on the page.
This resulted in generic_file_buffered_read() falling back to ->readpage(),
which would repeat the read request and succeed.  Because of the repeated
read succeeding the bug was not detected with regression tests or other use
cases.

The FTP module in GVFS however fails the second read due to the
non-seekable nature of FTP downloads.

Fix by checking and ignoring positive return value from
fuse_simple_request().

Reported-by: Ondrej Holy <oholy@redhat.com>
Link: https://gitlab.gnome.org/GNOME/gvfs/issues/441
Fixes: 134831e36b ("fuse: convert readpages to simple api")
Cc: <stable@vger.kernel.org> # v5.4
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2020-01-16 11:09:36 +01:00
..
Kconfig fuse: fix Kconfig indentation 2019-11-27 09:35:20 +01:00
Makefile virtio-fs: Change module name to virtiofs.ko 2019-10-14 10:20:33 +02:00
acl.c fuse: Support fuse filesystems outside of init_user_ns 2018-03-20 17:11:44 +01:00
control.c convenience helper: get_tree_single() 2019-07-04 22:01:58 -04:00
cuse.c fuse: fix memleak in cuse_channel_open 2019-09-24 15:28:01 +02:00
dev.c pipe: Fix iteration end check in fuse_dev_splice_write() 2019-12-06 13:57:04 -08:00
dir.c fuse: verify nlink 2019-11-12 11:49:04 +01:00
file.c fuse: fix fuse_send_readpages() in the syncronous read case 2020-01-16 11:09:36 +01:00
fuse_i.h fuse: verify attributes 2019-11-12 11:49:04 +01:00
inode.c virtio-fs: don't show mount options 2019-10-15 16:11:41 +02:00
readdir.c fuse: verify attributes 2019-11-12 11:49:04 +01:00
virtio_fs.c virtiofs: Use completions while waiting for queue to be drained 2019-11-22 13:29:50 +01:00
xattr.c fuse: rearrange and resize fuse_args fields 2019-09-10 16:29:48 +02:00