[CRIU] [RFC PATCH] util: shutdown log in cr_system_userns if error fd is negative

Pavel Emelyanov xemul at virtuozzo.com
Fri Apr 22 07:37:40 PDT 2016


On 04/22/2016 04:58 PM, Stanislav Kinsburskiy wrote:
> 
> 
> 22.04.2016 15:53, Pavel Emelyanov пишет:
>> On 04/22/2016 01:20 PM, Stanislav Kinsburskiy wrote:
>>> Otherwise error in case of exec error won't be printed
>>> The problem is that when err fd is negative, it's replaced by log fd.
>>> Then err is moved to STDERR (that means, that log_fd is _closed_).
>> Why, log fd is service fd, not STDERR one.
> 
> Not sure I got it correctly.
> There is an error message below the mentioned hunk:
> 
> pr_perror("exec failed");
> 
> In case err_fd is passes as "-1", this message will be never printed.
> Because:
> 1) err = log_fd();
> 2) err copied to STDERR and then closed (log_fd is actually closed)
> 
> Then in case of error criu tries to write to log_fd, because its service 
> fd bit is still set ===> Write fails.

Ah, I see. Patch applied, thanks.



More information about the CRIU mailing list