lazy-pages: fix searching for the page at #PF time

After commit a97d6d3f1609 (pagemap: replace seek_page with seek_pagemap
method), uffd only searches the pagemap containing the faulting page, but
it not for the page itself. For local restore it causes wrong data to be
read from pages*img and subsequent crash of the restored process.
Adding a call to pr->skip_pages fixes the problem.

travis-ci: success for lazy-pages: fix searching for the page at #PF time
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Mike Rapoport 2016-11-29 14:45:00 +03:00 committed by Andrei Vagin
parent c89a22a8e9
commit 450981caf0

View file

@ -604,6 +604,8 @@ static int uffd_seek_or_zero_pages(struct lazy_pages_info *lpi, __u64 address,
if (pagemap_zero(lpi->pr.pe))
return uffd_zero(lpi, address, nr);
lpi->pr.skip_pages(&lpi->pr, address - lpi->pr.pe->vaddr);
return 1;
}