[CRIU] [PATCH] page-read: don't check that an image file contains data

Pavel Emelyanov xemul at parallels.com
Thu Dec 26 09:58:51 PST 2013


On 12/26/2013 09:44 PM, Andrey Vagin wrote:
> Here are two reasons:
> * Image files can be moved. tar and rsync can replace zero chunks on
> holes.
> * maps04 fails sometimes.
> Restore log:
> /var/lib/jenkins/jobs/CRIU/workspace/test/dump/maps04/9871/1/restore.log
> --------------------------------- grep Error
> ---------------------------------
> (07.738266)      4: Error (page-read.c:145): Can't read page because of
> hole /1a143000: No such file or directory
> (07.799325)      1: Error (cr-restore.c:1065): 4 exited, status=1
> (07.799465) Error (cr-restore.c:1600): Restoring FAILED.
> 
> I tried to execute "criu restore" again and it completed successfully.
> so image files were valid.

Checking for holes was added explicitly to make sure we restore from dedup-ed
image properly. How can we address this?

> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  page-read.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/page-read.c b/page-read.c
> index 2afacf3..739b51c 100644
> --- a/page-read.c
> +++ b/page-read.c
> @@ -141,10 +141,6 @@ static int read_pagemap_page(struct page_read *pr, unsigned long vaddr, void *bu
>  		off_t current_vaddr = lseek(pr->fd_pg, 0, SEEK_CUR);
>  		pr_debug("\tpr%u Read page %lx from self %lx/%"PRIx64"\n", pr->id,
>  				vaddr, pr->cvaddr, current_vaddr);
> -		if (current_vaddr != lseek(pr->fd_pg, current_vaddr, SEEK_DATA)) {
> -			pr_perror("Can't read page because of hole /%"PRIx64, current_vaddr);
> -			return -1;
> -		}
>  		ret = read(pr->fd_pg, buf, PAGE_SIZE);
>  		if (ret != PAGE_SIZE) {
>  			pr_perror("Can't read mapping page %d", ret);
> 




More information about the CRIU mailing list