There is a race condition int pty.c when pty_close wakes up waiter on its
pair device before set TTY_OTHER_CLOSED flag.
It is possible on SMP or preempt kernel, waiter wakes up too early that it
will not get TTY_OTHER_CLOSED flag then fall into sleep again - missed wakeup.
hjl reports that this bug will hang some expect scripts on SMP machines.
Signed-off-by: Zou Nan hai <Nanhai.zou@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>