[Devel] [PATCH rh7 2/3] Revert "ve/pty: containerize Unix98 driver"

Cyrill Gorcunov gorcunov at virtuozzo.com
Thu Jul 23 09:08:47 PDT 2015


On Thu, Jul 23, 2015 at 06:54:36PM +0300, Vladimir Davydov wrote:
...
> @@ -53,11 +58,11 @@ static void pty_close(struct tty_struct *tty, struct file *filp)
>  	if (tty->driver->subtype == PTY_TYPE_MASTER) {
>  		set_bit(TTY_OTHER_CLOSED, &tty->flags);
>  #ifdef CONFIG_UNIX98_PTYS
> -		if (tty->driver == tty->driver->ve->ptm_driver) {
> -			mutex_lock(&tty->driver->ve->devpts_mutex);
> +		if (tty->driver == ptm_driver) {
> +			mutex_lock(&devpts_mutex);
>  			if (tty->link->driver_data)
>  				devpts_pty_kill(tty->link->driver_data);
> -			mutex_unlock(&tty->driver->ve->devpts_mutex);
> +			mutex_unlock(&devpts_mutex);
>  		}
>  #endif

While I agree in general (but will review more precisely later)
making @devpts_mutex been one global mutex is a bad idea -- now
any container may start opening/closing ptys affecting other
containers and node as well (simply opening/closing pty pair in cycle).
This should not be that serious impact though because it affects
only others open/close but still...



More information about the Devel mailing list