[CRIU] [PATCH] ns: Use generate_ns_id instead of plain lookup in dump_one_ns_file

Pavel Emelyanov xemul at parallels.com
Mon May 20 07:08:26 EDT 2013


On 05/20/2013 03:05 PM, Cyrill Gorcunov wrote:
> On Mon, May 20, 2013 at 02:57:38PM +0400, Pavel Emelyanov wrote:
>>> diff --git a/namespaces.c b/namespaces.c
>>> index 5928bd5..28f55d2 100644
>>> --- a/namespaces.c
>>> +++ b/namespaces.c
>>> @@ -198,11 +198,9 @@ int dump_one_ns_file(int lfd, u32 id, const struct fd_parms *p)
>>>  	struct fd_link *link = p->link;
>>>  	unsigned int nsid;
>>>  
>>> -	nsid = lookup_ns_id(link->ns_kid, link->ns_d);
>>> -	if (!nsid) {
>>> -		pr_err("No NS ID with kid %u\n", link->ns_kid);
>>> +	nsid = generate_ns_id(p->pid, link->ns_kid, link->ns_d);
>>
>> I don't quite understand this change. The generate_ will create a new ns_id
>> entry if required would not be found. But all the namespaces we _can_ see in
>> this dump have already been hashed by get_task_ns_ids before any other dumps.
> 
> If I'm not mistaken, we can have a situation when task 1 opens ns from task 2,
> when ns-ids of task 2 have not yet been hashed, 

How? In CRIU namespaces' IDs hashing happens at tasks' collect stage.

> and i think we should print
> "no support for nested namespaces" message here insted, and generate_ns_id
> will do that for us, right?
> .
> 




More information about the CRIU mailing list