[CRIU] [PATCH v3 05/19] lazy-pages: fix zero pages handling

Mike Rapoport rppt at linux.vnet.ibm.com
Tue Nov 15 08:57:14 PST 2016


page_read->seek_page was restored to skip zero pagemaps, therefore we
should check its return value rather than underlying PME.

Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
---
 criu/uffd.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/criu/uffd.c b/criu/uffd.c
index ed99c8a..6c3f295 100644
--- a/criu/uffd.c
+++ b/criu/uffd.c
@@ -571,7 +571,11 @@ static int uffd_handle_page(struct lazy_pages_info *lpi, __u64 address,
 		return ret;
 	}
 
-	if (pagemap_zero(lpi->pr.pe))
+	/*
+	 * FIXME: rework zeroes handling so we won't need to rely on
+	 * seek_page return value here
+	 */
+	if (ret == 0 || pagemap_zero(lpi->pr.pe))
 		return uffd_zero_page(lpi, address);
 
 	if (opts.use_page_server)
-- 
1.9.1



More information about the CRIU mailing list