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

Andrei Vagin avagin at openvz.org
Thu Dec 8 17:14:01 PST 2016


https://github.com/xemul/criu/issues/260

v2: don't call page_pipe_add_hole for zero pages
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..8d4869b 100644
--- a/criu/shmem.c
+++ b/criu/shmem.c
@@ -711,8 +711,10 @@ static int dump_one_shmem(struct shmem_info *si)
 again:
 		if (xfer.parent && page_in_parent(pgstate == PST_DIRTY))
 			ret = page_pipe_add_hole(pp, pgaddr);
-		else
+		else if (pgstate != PST_ZERO)
 			ret = page_pipe_add_page(pp, pgaddr);
+		else
+			ret = 0;
 
 		if (ret == -EAGAIN) {
 			ret = dump_pages(pp, &xfer, addr);
-- 
2.7.4



More information about the CRIU mailing list