[CRIU] Re: [PATCH] restore: close opened fd

Kinsbursky Stanislav skinsbursky at openvz.org
Mon Feb 20 09:16:08 EST 2012


20.02.2012 17:29, Cyrill Gorcunov пишет:
> On Mon, Feb 20, 2012 at 04:18:42PM +0300, Kinsbursky Stanislav wrote:
>> This is a cleanup patch. It adds some close() calls where required and
>> replaces close() with closer_safe().
>>
>> Signed-off-by: Stanislav Kinsbursky<skinsbursky at openvz.org>
>> ---
>>
> ...
>>   		pr_info("%d: Restoring shared page: %16lx\n", pid, va);
>>   		write(fd,&va, sizeof(va));
>> -		sendfile(fd, pgfd, NULL, PAGE_SIZE);
>> +		sendfile(fd, shmfd, NULL, PAGE_SIZE);
>>   	}
>>
> We can add ret = 0 here and drop (ret<  0) at runction return
> I think, no?
>
> Other than that looks good to me, thanks Stas! I presume it fixes
> problem with dangling opened log file on restore?
>
> 	Cyrill

Nope. I thought the same, but it's not.
Next patch solves it.

-- 
Best regards,
Stanislav Kinsbursky




More information about the CRIU mailing list