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

Andrei Vagin avagin at gmail.com
Thu Aug 22 18:15:20 MSK 2019


On Wed, Aug 21, 2019 at 04:37:01AM +0530, Abhishek Dubey wrote:
> 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;

you need to add a comment here which explains why we need this
decrement.
> +
>  	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