[CRIU] [PATCH master] shmem: don't write zero pages into an image

Andrei Vagin avagin at openvz.org
Thu Dec 8 15:23:46 PST 2016


https://github.com/xemul/criu/issues/260
Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 criu/shmem.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/criu/shmem.c b/criu/shmem.c
index 0eb4250..707bede 100644
--- a/criu/shmem.c
+++ b/criu/shmem.c
@@ -709,7 +709,9 @@ static int dump_one_shmem(struct shmem_info *si)
 
 		pgaddr = (unsigned long)addr + pfn * PAGE_SIZE;
 again:
-		if (xfer.parent && page_in_parent(pgstate == PST_DIRTY))
+		if (pgstate == PST_ZERO)
+			ret = page_pipe_add_hole(pp, pgaddr);
+		else if (xfer.parent && page_in_parent(pgstate == PST_DIRTY))
 			ret = page_pipe_add_hole(pp, pgaddr);
 		else
 			ret = page_pipe_add_page(pp, pgaddr);
-- 
2.7.4



More information about the CRIU mailing list