]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
orangefs_bufmap_copy_from_iovec(): fix EFAULT handling
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 13 Apr 2017 07:10:18 +0000 (03:10 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 17 Apr 2017 18:23:20 +0000 (14:23 -0400)
short copy here should mean instant EFAULT, not "move to the
next page and hope it fails there, this time with nothing
copied"

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/orangefs/orangefs-bufmap.c

index 6333cbbdfef7ae652c1a4e6c4d2818ae1cd188d7..83b506020718980a69e5285a8c86496c14a2d050 100644 (file)
@@ -521,13 +521,11 @@ int orangefs_bufmap_copy_from_iovec(struct iov_iter *iter,
                size_t n = size;
                if (n > PAGE_SIZE)
                        n = PAGE_SIZE;
-               n = copy_page_from_iter(page, 0, n, iter);
-               if (!n)
+               if (copy_page_from_iter(page, 0, n, iter) != n)
                        return -EFAULT;
                size -= n;
        }
        return 0;
-
 }
 
 /*