2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 13:28:27 +00:00

lazy-pages: zero out pages not covered by the pagemap

If a page was not marked "present" at the dump time it will not be covered
by the pagemap and it will remain unmapped in the restored process. We
should uffdio_zero such pages and let kernel mm to take over.

travis-ci: success for revert zero pagemaps
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-12-15 14:10:37 +02:00 committed by Andrei Vagin
parent 4335be91bf
commit 0019a68ce5

View File

@ -588,10 +588,7 @@ static int uffd_seek_or_zero_pages(struct lazy_pages_info *lpi, __u64 address,
lpi->pr.reset(&lpi->pr);
ret = lpi->pr.seek_pagemap(&lpi->pr, address);
if (!ret)
return 0;
if (pagemap_zero(lpi->pr.pe))
if (!ret || pagemap_zero(lpi->pr.pe))
return uffd_zero(lpi, address, nr);
lpi->pr.skip_pages(&lpi->pr, address - lpi->pr.pe->vaddr);