[CRIU] [PATCH 2/2] criu: don't trigger a bug if a task wants to restore a root mntns

Pavel Emelyanov xemul at parallels.com
Fri Nov 27 05:59:26 PST 2015


>>> @@ -2656,8 +2656,6 @@ void fini_restore_mntns(void)
>>>  	for (nsid = ns_ids; nsid != NULL; nsid = nsid->next) {
>>>  		if (nsid->nd != &mnt_ns_desc)
>>>  			continue;
>>> -		if (root_item->ids->mnt_ns_id == nsid->id)
>>> -			continue;
>>
>> How about skipping NS_CRIU namespace? Is it on the list?
> 
> Nom it isn't.

Good :)

>>
>>>  		close(nsid->mnt.ns_fd);
>>>  	}
>>>  }
>>> @@ -2856,8 +2854,13 @@ int prepare_mnt_ns(void)
>>>  
>>>  		if (nsid->nd != &mnt_ns_desc)
>>>  			continue;
>>> -		if (root_item->ids->mnt_ns_id == nsid->id)
>>> +		if (root_item->ids->mnt_ns_id == nsid->id) {
>>
>> Maybe fix this check to be nsid->type == NS_ROOT?
> 
> We can. It's the same.

Please.

>>
>>> +			/* Pin one with a file descriptor */
>>> +			nsid->mnt.ns_fd = open_proc(PROC_SELF, "ns/mnt");
>>> +			if (nsid->mnt.ns_fd < 0)
>>> +				goto err;
>>>  			continue;
>>> +		}
>>>  
>>>  		/* Create the new mount namespace */
>>>  		if (unshare(CLONE_NEWNS)) {
>>>
>>
> .
> 



More information about the CRIU mailing list