criu: pagemap: skip zero pages while seeking for a page

Submitted by Mike Rapoport on Oct. 18, 2016, 4:42 a.m.

Details

Message ID 1476765759-12753-1-git-send-email-rppt@linux.vnet.ibm.com
State Accepted
Series "criu: pagemap: skip zero pages while seeking for a page"
Commit 4ee30b10435eb15a9a60d540d993977d6e3b2ed7
Headers show

Commit Message

Mike Rapoport Oct. 18, 2016, 4:42 a.m.
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@virtuozzo.com>
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
---
 criu/pagemap.c | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

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;
 

Comments

Pavel Emelianov Oct. 19, 2016, 7:27 a.m.
Applied