diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-04-13 10:10:18 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-04-17 21:23:20 +0300 |
commit | 890559e34eac1fb90a4b5916d4a1387376a05d51 (patch) | |
tree | bc13690fd3d6c481a05ca416a92710b0816f64ec /fs/orangefs | |
parent | 4f7d029b9bf009fbee76bb10c0c4351a1870d2f3 (diff) | |
download | linux-890559e34eac1fb90a4b5916d4a1387376a05d51.tar.xz |
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 <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/orangefs')
-rw-r--r-- | fs/orangefs/orangefs-bufmap.c | 4 |
1 files changed, 1 insertions, 3 deletions
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; - } /* |