[CRIU] Re: [PATCH cr 07/16] restore: map private vma-s before
forking children
Pavel Emelyanov
xemul at parallels.com
Thu Nov 1 06:54:00 EDT 2012
On 10/31/2012 02:16 PM, Andrey Vagin wrote:
> On Tue, Oct 30, 2012 at 10:56:13PM +0400, Pavel Emelyanov wrote:
>>>>
>>>>> + break;
>>>>> + }
>>>>> +
>>>>> + }
>>>>> +
>>>>> + *pvma = list_entry(p->list.prev, struct vma_area, list);
>>>>
>>>> prev? Why prev? We should move forward the parent list. No?
>>>
>>> list_for_each_entry_continue() starts from a next element, so we need to
>>> save prev here.
>>
>> Indeed. Then the initialization of the pvma with _first_ element is wrong,
>> you should start with the list head instead.
>
> Yes, thanks.
>>
>>>>
>>>>> +
>>>>> + list_del(&p->list);
>>>>> + xfree(p);
>>>>
>>>> Why do we remove parent vma from its list?
>>>
>>> Then all unused parent's vma-s will be unmapped.
>>
>> What do you mean by "unused"?
>
> This vma-s are present in parent and they are not present in a child.
What if it's present in grand-child again?
More information about the CRIU
mailing list