Merge tag 'fuse-fixes-5.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mszer...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 17 Jan 2020 16:42:02 +0000 (08:42 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 17 Jan 2020 16:42:02 +0000 (08:42 -0800)
Pull fuse fix from Miklos Szeredi:
 "Fix a regression in the last release affecting the ftp module of the
  gvfs filesystem"

* tag 'fuse-fixes-5.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
  fuse: fix fuse_send_readpages() in the syncronous read case

fs/fuse/file.c

index a63d779..ce71538 100644 (file)
@@ -882,6 +882,7 @@ static void fuse_send_readpages(struct fuse_io_args *ia, struct file *file)
        struct fuse_args_pages *ap = &ia->ap;
        loff_t pos = page_offset(ap->pages[0]);
        size_t count = ap->num_pages << PAGE_SHIFT;
+       ssize_t res;
        int err;
 
        ap->args.out_pages = true;
@@ -896,7 +897,8 @@ static void fuse_send_readpages(struct fuse_io_args *ia, struct file *file)
                if (!err)
                        return;
        } else {
-               err = fuse_simple_request(fc, &ap->args);
+               res = fuse_simple_request(fc, &ap->args);
+               err = res < 0 ? res : 0;
        }
        fuse_readpages_end(fc, &ap->args, err);
 }