[CRIU] [PATCHv1 22/26] page-pipe: grow page pipe on compatible iovec size

Dmitry Safonov dsafonov at virtuozzo.com
Thu Jun 16 03:53:39 PDT 2016


Update pointer to first free iov on page pipe growing
according to compat_iov flag.

Cc: Cyrill Gorcunov <gorcunov at openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
 criu/page-pipe.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/criu/page-pipe.c b/criu/page-pipe.c
index db597b27f1e2..591935771b4d 100644
--- a/criu/page-pipe.c
+++ b/criu/page-pipe.c
@@ -109,6 +109,7 @@ static inline void iov_init_compat(struct iovec_compat *iov, unsigned long addr)
 static int page_pipe_grow(struct page_pipe *pp, unsigned int flags)
 {
 	struct page_pipe_buf *ppb;
+	struct iovec *free_iov;
 
 	pr_debug("Will grow page pipe (iov off is %u)\n", pp->free_iov);
 
@@ -126,7 +127,11 @@ static int page_pipe_grow(struct page_pipe *pp, unsigned int flags)
 		return -1;
 
 out:
-	ppb_init(ppb, 0, 0, flags, &pp->iovs[pp->free_iov]);
+	if (pp->compat_iov)
+		free_iov = (void*)&((struct iovec_compat*)pp->iovs)[pp->free_iov];
+	else
+		free_iov = &pp->iovs[pp->free_iov];
+	ppb_init(ppb, 0, 0, flags, free_iov);
 
 	return 0;
 }
-- 
2.8.3



More information about the CRIU mailing list