[CRIU] [PATCH] dump: Don't close pid-proc in vain

Pavel Emelyanov xemul at parallels.com
Tue Sep 23 09:44:24 PDT 2014


On 09/23/2014 01:39 PM, Andrew Vagin wrote:
> On Mon, Sep 22, 2014 at 05:40:02PM +0400, Pavel Emelyanov wrote:
>> The open_pid_proc engine knows itself how to cache
>> per-pid descriptors. No need in closing it by hands.
>>
>> Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
>>
>> ---
>>
>> diff --git a/cr-dump.c b/cr-dump.c
>> index d00c158..890d60a 100644
>> --- a/cr-dump.c
>> +++ b/cr-dump.c
>> @@ -1041,8 +1041,6 @@ static int collect_task(struct pstree_item *item)
>>  	if (pstree_alloc_cores(item))
>>  		goto err_close;
>>  
>> -	close_pid_proc();
>> -
>>  	pr_info("Collected %d in %d state\n", item->pid.real, item->state);
>>  	return 0;
> err_close:
>         close_pid_proc();
> 		^^^
> Let's remove close_pid_proc() from here too?

I don't mind, but we have much more of them on other error paths :)
Error paths are not interesting from this perspective, however.

>         return -1;
> }
> 
>>  
>> _______________________________________________
>> CRIU mailing list
>> CRIU at openvz.org
>> https://lists.openvz.org/mailman/listinfo/criu
> .
> 



More information about the CRIU mailing list