[CRIU] [PATCH] criu: tty -- Restore tty params synchronously

Pavel Emelyanov xemul at virtuozzo.com
Wed May 4 07:39:37 PDT 2016


On 05/04/2016 10:36 AM, Cyrill Gorcunov wrote:
> On Wed, May 04, 2016 at 10:22:17AM +0300, Pavel Emelyanov wrote:
>>>
>>> You know, we may fail inbetween, having restore-tty-params request in the fly.
>>> Imagine
>>>
>>> pty_open_unpaired_slave
>>> pty_open_slaves
>>>   ...
>>>   fd = open_tty_reg()
>>>   restore_tty_params --> sends request
>>>   send_fd_to_peer(fd) -> it fails
>>>   close_safe(&fd);
>>>   return -1;
>>> now pty_open_unpaired_slave will close the master but then in-flight
>>> request may start and will exit with error.
>>
>> Still, send_fd_to_peer() failed and we exit with error anyway.
> 
> It doesn't matter. It's bloody wrong calling the function which
> _implies_ that tty is alive on dead tty. That's the point.

If (!) this is done on error paths, then it's ... affordable. Doing
synchronous usernsd calls is worse.

> Either
> we should call it in sync way, either should provide own completions
> on tty side (which is the same as use sync flag). Frankly, Pavel,
> this cause unexpected problems for no gain.
> .
> 



More information about the CRIU mailing list