[CRIU] [PATCH] vdso: Get pagemap entries with pread call

Andrew Vagin avagin at parallels.com
Thu Feb 13 12:58:08 PST 2014


Acked-by:Andrew Vagin <avagin at parallels.com>

On Thu, Feb 13, 2014 at 04:56:28PM +0400, Pavel Emelyanov wrote:
> Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
> ---
>  arch/x86/vdso.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/arch/x86/vdso.c b/arch/x86/vdso.c
> index fe55af4..0a59e23 100644
> --- a/arch/x86/vdso.c
> +++ b/arch/x86/vdso.c
> @@ -136,14 +136,7 @@ int parasite_fixup_vdso(struct parasite_ctl *ctl, pid_t pid,
>  		}
>  
>  		off = (vma->e->start / PAGE_SIZE) * sizeof(u64);
> -		if (lseek(fd, off, SEEK_SET) != off) {
> -			pr_perror("Failed to seek address %lx\n",
> -				  (long unsigned int)vma->e->start);
> -			ret = -1;
> -			goto err;
> -		}
> -
> -		ret = read(fd, &pfn, sizeof(pfn));
> +		ret = pread(fd, &pfn, sizeof(pfn), off);
>  		if (ret < 0 || ret != sizeof(pfn)) {
>  			pr_perror("Can't read pme for pid %d", pid);
>  			ret = -1;
> -- 
> 1.8.4.2
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list