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

Cyrill Gorcunov gorcunov at virtuozzo.com
Thu Apr 21 07:13:02 PDT 2016


On Thu, Apr 21, 2016 at 05:10:46PM +0300, Cyrill Gorcunov wrote:
> Async call to do_restore_tty_parms may have a side effect -- the caller
> doesn't wait for its completion and continue processing tty associated
> with the fd. userns_call carries own copy of file descriptor and if
> main code in tty fails then both slave and master may be closed
> and only one file descriptor remains: the one which userns carries,
> but the terminal already dead, so when we call do_restore_tty_parms
> on it we get -EIO.
> 
> Thus simply run params restoration on peers in sync'ed way when we
> know terminal peers both exist and valid.
> 
> https://jira.sw.ru/browse/PSBM-46382
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at virtuozzo.com>

Actually there might be other side effects as well. For example
in the bug above (which please rip off from the commit message
when be merging):

...
(01.346469) Error (tty.c:751): tty: Can't set tty params on 1156: Input/output error
(01.346475) Error (namespaces.c:1238): uns: Async call failed. Exiting
...


More information about the CRIU mailing list