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

Pavel Emelyanov xemul at virtuozzo.com
Thu Apr 21 10:48:49 PDT 2016


On 04/21/2016 05:32 PM, Cyrill Gorcunov wrote:
> On Thu, Apr 21, 2016 at 05:22:21PM +0300, Pavel Emelyanov wrote:
>> On 04/21/2016 05:10 PM, 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.
>>
>> But the restore fails anyway, so we do we care?
> 
> Yes we care. The restoration of params must be done on alive terminals.

OK, but if terminal is dead, then the restore is failing. So why not
have one more failure in logs?

> Both peers must be alive when we do such action. The idea behind of
> restoring terminal params relies on this fact. Such races really
> hard to catch :/
> .
> 



More information about the CRIU mailing list