Skip to content

Commit

Permalink
[PATCH] vmsplice: fix badly placed end paranthesis
Browse files Browse the repository at this point in the history
We need to use the minium of {len, PAGE_SIZE-off}, not {len, PAGE_SIZE}-off.
The latter doesn't make any sense, and could cause us to attempt negative
length transfers...

Signed-off-by: Jens Axboe <axboe@suse.de>
  • Loading branch information
Jens Axboe committed May 2, 2006
1 parent 532f57d commit 7591489
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ static int get_iovec_page_array(const struct iovec __user *iov,
* Fill this contiguous range into the partial page map.
*/
for (i = 0; i < error; i++) {
const int plen = min_t(size_t, len, PAGE_SIZE) - off;
const int plen = min_t(size_t, len, PAGE_SIZE - off);

partial[buffers].offset = off;
partial[buffers].len = plen;
Expand Down

0 comments on commit 7591489

Please sign in to comment.