generally speaking terminal resize could be made from vc or otherterminal device module code, from terminal ioctl on tty masteror tty slave. As we read the code we will see that the problem is touse a proper mutex. Also we should use a one variable in which we setterminal sizes. So in case of tty master and slave we have tty andreal_tty structures. TIOCSWINSZ and TIOCGWINSZ ioctls could becalled on tty and real_tty at the same time. To avoid race conditionwe should use a mutex. But this must be the same mutex in all cases- tty or real_tty. For the best we should also use the samewinsize variable. Proposed previously code change only simplifiesthe code and eliminates SIGWINCH signal race but an app could readterminal sizes at any time so this patch not closes all racepossibilities. So I propose a patch in which we have some codemovements and always use real_tty->termios_mutex and alsoreal_tty->winsize. In no pty case tty == real_tty so it works properlyas before and in pty situaction we use the same mutex and variable soit removes all race conditions according to access to winsize now.