]> git.neil.brown.name Git - history.git/commit
[PATCH] Fix a race condition in pty.c
authorZou Nanhai <nanhai.zou@intel.com>
Sat, 18 Dec 2004 09:17:31 +0000 (01:17 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 18 Dec 2004 09:17:31 +0000 (01:17 -0800)
commitd2dc1db05062089d6cef496a6c214a3825c3024d
treedffcaefecc9f97e5a19fda2e8067994863bf570d
parentf89cf87cb3bf03fd238c5eb5bbc0c55ea919db06
[PATCH] Fix a race condition in pty.c

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>
drivers/char/pty.c