[CRIU] [PATCH 3/4] mount: master_id should be 0 for new mounts

Pavel Emelyanov xemul at virtuozzo.com
Wed Mar 9 23:50:21 PST 2016


On 03/10/2016 01:28 AM, Andrew Vagin wrote:
> On Wed, Mar 09, 2016 at 08:17:22PM +0300, Pavel Emelyanov wrote:
>> On 03/09/2016 08:15 PM, Andrew Vagin wrote:
>>> On Wed, Mar 09, 2016 at 12:58:00PM +0300, Pavel Emelyanov wrote:
>>>> On 03/03/2016 10:00 AM, Andrey Vagin wrote:
>>>>> From: Andrew Vagin <avagin at virtuozzo.com>
>>>>
>>>> Why?
>>>
>>> A new mount can't be slave for someone, because it's a new one
>>
>> But the master_id value comes from images, doesn't it?
> 
> Yes, it does. But we should not call this function if master_id isn't zero.

Where do we make this decision in the code? Please, add code comment
about it.

>>
>>>>
>>>>> Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
>>>>> ---
>>>>>  criu/mount.c | 5 ++---
>>>>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>>>>
>>>>> diff --git a/criu/mount.c b/criu/mount.c
>>>>> index ffafcf3..20a95d1 100644
>>>>> --- a/criu/mount.c
>>>>> +++ b/criu/mount.c
>>>>> @@ -2259,9 +2259,8 @@ static int do_new_mount(struct mount_info *mi)
>>>>>  		return -1;
>>>>>  	}
>>>>>  
>>>>> -	if (restore_shared_options(mi, !mi->shared_id && !mi->master_id,
>>>>> -					mi->shared_id,
>>>>> -					mi->master_id))
>>>>> +	BUG_ON(mi->master_id);
>>>>> +	if (restore_shared_options(mi, !mi->shared_id, mi->shared_id, 0))
>>>>>  		return -1;
>>>>>  
>>>>>  	mi->mounted = true;
>>>>>
>>>>
>>> .
>>>
>>
> .
> 



More information about the CRIU mailing list