[CRIU] [PATCH] proc_parse: Borrow vmi iif there is file referenced

Pavel Emelyanov xemul at parallels.com
Thu Mar 6 09:27:37 PST 2014


On 03/06/2014 08:02 PM, Cyrill Gorcunov wrote:
> On Thu, Mar 06, 2014 at 07:27:19PM +0400, Pavel Emelyanov wrote:
>> 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 :)
> 
> How it gets 0 here? alloc_vma_area sets it to -1

Hm.. Indeed :)

> then this area become a previous
> one and the next call to vma_get_mapfile simply exit with 0 without
> modifying this member. I seem to get confused.
> .
> 




More information about the CRIU mailing list