diff options
author | Jens Axboe <axboe@suse.de> | 2006-05-02 06:57:18 -0400 |
---|---|---|
committer | Jens Axboe <axboe@suse.de> | 2006-05-02 06:57:18 -0400 |
commit | 7591489a8fbee83f19bacc75756989a6a4d0389c (patch) | |
tree | ec185e3788e3c3f123ff3ee00b18441467eb4486 | |
parent | 532f57da408c5a5710075d17047e2d97bdfd22f3 (diff) |
[PATCH] vmsplice: fix badly placed end paranthesis
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>
-rw-r--r-- | fs/splice.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/splice.c b/fs/splice.c index b150493b6fc3..b0c157d76948 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -1143,7 +1143,7 @@ static int get_iovec_page_array(const struct iovec __user *iov, | |||
1143 | * Fill this contiguous range into the partial page map. | 1143 | * Fill this contiguous range into the partial page map. |
1144 | */ | 1144 | */ |
1145 | for (i = 0; i < error; i++) { | 1145 | for (i = 0; i < error; i++) { |
1146 | const int plen = min_t(size_t, len, PAGE_SIZE) - off; | 1146 | const int plen = min_t(size_t, len, PAGE_SIZE - off); |
1147 | 1147 | ||
1148 | partial[buffers].offset = off; | 1148 | partial[buffers].offset = off; |
1149 | partial[buffers].len = plen; | 1149 | partial[buffers].len = plen; |