Skip to content

Commit 890559e

Browse files
author
Al Viro
committed
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 <[email protected]>
1 parent 4f7d029 commit 890559e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/orangefs/orangefs-bufmap.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,13 +521,11 @@ int orangefs_bufmap_copy_from_iovec(struct iov_iter *iter,
521521
size_t n = size;
522522
if (n > PAGE_SIZE)
523523
n = PAGE_SIZE;
524-
n = copy_page_from_iter(page, 0, n, iter);
525-
if (!n)
524+
if (copy_page_from_iter(page, 0, n, iter) != n)
526525
return -EFAULT;
527526
size -= n;
528527
}
529528
return 0;
530-
531529
}
532530

533531
/*

0 commit comments

Comments
 (0)