[CRIU] [PATCH] proc_parse: Borrow vmi iif there is file referenced
Pavel Emelyanov
xemul at parallels.com
Thu Mar 6 07:27:19 PST 2014
On 03/06/2014 06:02 PM, Cyrill Gorcunov wrote:
> On Thu, Mar 06, 2014 at 04:51:38PM +0400, Pavel Emelyanov wrote:
>>
>> Hm... Can we do it like this
>>
>> if (prev->vm_file_fd < 0)
>> return 0;
>>
>> Since for anonymous mappings dev:ino would be 0:0 (matching) and we don't
>> even need to try messing the map_files -- it will be absent for sure.
>
> Like this?
>
Not exactly (I withdraw the previous comment).
> @@ -172,6 +172,13 @@ static int vma_get_mapfile(struct vma_area *vma, DIR *mfd,
> if (prev_vfi->vma && vfi_equal(vfi, prev_vfi)) {
> struct vma_area *prev = prev_vfi->vma;
>
> + /*
> + * If vfi is equal (!) and negative @vm_file_fd --
> + * we have nothing to borrow for sure.
> + */
> + if (prev->vm_file_fd < 0)
The vma->vm_file_id = -1; should be here. Otherwise it's 0 and the rest
of criu code thinks it's a file descriptor 0 :)
> + return 0;
> +
> pr_debug("vma %"PRIx64" borrows vfi from previous %"PRIx64"\n",
> vma->e->start, prev->e->start);
> vma->vm_file_fd = prev->vm_file_fd;
More information about the CRIU
mailing list