diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-04-13 03:10:18 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-04-17 14:23:20 -0400 |
commit | 890559e34eac1fb90a4b5916d4a1387376a05d51 (patch) | |
tree | bc13690fd3d6c481a05ca416a92710b0816f64ec | |
parent | 4f7d029b9bf009fbee76bb10c0c4351a1870d2f3 (diff) |
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>
-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, | |||
521 | size_t n = size; | 521 | size_t n = size; |
522 | if (n > PAGE_SIZE) | 522 | if (n > PAGE_SIZE) |
523 | n = PAGE_SIZE; | 523 | n = PAGE_SIZE; |
524 | n = copy_page_from_iter(page, 0, n, iter); | 524 | if (copy_page_from_iter(page, 0, n, iter) != n) |
525 | if (!n) | ||
526 | return -EFAULT; | 525 | return -EFAULT; |
527 | size -= n; | 526 | size -= n; |
528 | } | 527 | } |
529 | return 0; | 528 | return 0; |
530 | |||
531 | } | 529 | } |
532 | 530 | ||
533 | /* | 531 | /* |