From 0019a68ce5dc76e8cfa6d1a683a38737532d8a0e Mon Sep 17 00:00:00 2001 From: Mike Rapoport Date: Thu, 15 Dec 2016 14:10:37 +0200 Subject: [PATCH] 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 Signed-off-by: Pavel Emelyanov --- criu/uffd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/criu/uffd.c b/criu/uffd.c index e55a9596c..f0fae586a 100644 --- a/criu/uffd.c +++ b/criu/uffd.c @@ -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);