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

Pavel Emelyanov xemul at parallels.com
Wed Sep 24 04:46:36 PDT 2014


On 09/24/2014 11:18 AM, Andrew Vagin wrote:
> On Tue, Sep 23, 2014 at 08:44:24PM +0400, Pavel Emelyanov wrote:
>> 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.
> 
> I'm agree, but I don't want to think in a future why do we have it in a
> error path and doesn't have in another case. So it's just for easy
> reading.

O'RLY? In that case I'd suggest reading the __mntns_get_root_fd() and
guessing why this call is there at all :)

Thanks,
Pavel



More information about the CRIU mailing list