[CRIU] [PATCH 6/7] Handle vmsplice failure for read mode pre-dump

Abhishek Dubey dubeyabhishek777 at gmail.com
Wed Aug 21 02:07:01 MSK 2019


vmsplice fails to completely splice 512 pages
from user-buffer to ppb pipes. Last page is
partially spliced.
To overcome this, we will have ppb pipes of 512
pages but splicing will be of 511 pages at most.

Signed-off-by: Abhishek Dubey <dubeyabhishek777 at gmail.com>
---
 criu/page-pipe.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/criu/page-pipe.c b/criu/page-pipe.c
index a821696..8730654 100644
--- a/criu/page-pipe.c
+++ b/criu/page-pipe.c
@@ -38,6 +38,10 @@ static int __ppb_resize_pipe(struct page_pipe_buf *ppb, unsigned long new_size)
 		return -1;
 
 	ret /= PAGE_SIZE;
+
+	if (opts.pre_dump_mode == PRE_DUMP_READ)
+		ret -= 1;
+
 	BUG_ON(ret < ppb->pipe_size);
 
 	pr_debug("Grow pipe %x -> %x\n", ppb->pipe_size, ret);
-- 
2.7.4



More information about the CRIU mailing list