[CRIU] [PATCH] criu: pagemap: skip zero pages while seeking for a page

Mike Rapoport rppt at linux.vnet.ibm.com
Mon Oct 17 21:42:39 PDT 2016


The commit 95009c4c6d5 (criu: pagemap: introduce advance() helper for
pagemap iteration) didn't take into account that seek_pagemap_page assumes
that zero pagemaps are skipped by get_pagemap.
Adding explicit check for zero pagemaps in seek_pagemap_page resolves the
issue.

Fixes: #224

Reported-by: Andrei Vagin <avagin at virtuozzo.com>
Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
---
 criu/pagemap.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/criu/pagemap.c b/criu/pagemap.c
index 49362e3..21439aa 100644
--- a/criu/pagemap.c
+++ b/criu/pagemap.c
@@ -174,6 +174,9 @@ static int seek_pagemap_page(struct page_read *pr, unsigned long vaddr,
 		unsigned long len = pr->pe->nr_pages * PAGE_SIZE;
 		unsigned long end = start + len;
 
+		if (pagemap_zero(pr->pe))
+			continue;
+
 		if (vaddr < pr->cvaddr)
 			break;
 
-- 
1.9.1



More information about the CRIU mailing list