From: Al Viro Date: Thu, 13 Apr 2017 07:10:18 +0000 (-0400) Subject: orangefs_bufmap_copy_from_iovec(): fix EFAULT handling X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=890559e34eac1fb90a4b5916d4a1387376a05d51;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git orangefs_bufmap_copy_from_iovec(): fix EFAULT handling 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 --- diff --git a/fs/orangefs/orangefs-bufmap.c b/fs/orangefs/orangefs-bufmap.c index 6333cbbdfef7..83b506020718 100644 --- a/fs/orangefs/orangefs-bufmap.c +++ b/fs/orangefs/orangefs-bufmap.c @@ -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; - } /*