Commit a33b747f authored by Mike Rapoport's avatar Mike Rapoport Committed by Andrei Vagin

lazy-pages: fix off-by-one in remap_lazy_iovs

When the remap 'from' parameter matches an IOV end we try to split that IOV
exactly at its end and effectively create an IOV with zero length.
With the off-by-one fix we will skip the IOV in such case as expected.
Signed-off-by: 's avatarMike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent b1aca099
...@@ -481,7 +481,7 @@ static int remap_lazy_iovs(struct lazy_pages_info *lpi, unsigned long from, ...@@ -481,7 +481,7 @@ static int remap_lazy_iovs(struct lazy_pages_info *lpi, unsigned long from,
list_for_each_entry_safe(iov, n, &lpi->iovs, l) { list_for_each_entry_safe(iov, n, &lpi->iovs, l) {
unsigned long iov_end = iov->base + iov->len; unsigned long iov_end = iov->base + iov->len;
if (from > iov_end) if (from >= iov_end)
continue; continue;
if (len <= 0 || from + len < iov->base) if (len <= 0 || from + len < iov->base)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment