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

Cyrill Gorcunov gorcunov at virtuozzo.com
Wed May 4 00:36:03 PDT 2016


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. 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