]> err.no Git - linux-2.6/commitdiff
[PATCH] vmsplice: fix badly placed end paranthesis
authorJens Axboe <axboe@suse.de>
Tue, 2 May 2006 10:57:18 +0000 (12:57 +0200)
committerJens Axboe <axboe@suse.de>
Tue, 2 May 2006 10:57:18 +0000 (12:57 +0200)
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>
fs/splice.c

index b150493b6fc33defb17dac4f3af8b28379a33d8d..b0c157d76948e407bed8087c09ec47c7fb474fc3 100644 (file)
@@ -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;