diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2014-11-05 18:13:01 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-06 03:50:42 +0100 |
commit | 2aff5e2bc62db43e05c814461a08aff0fc2b7fe5 (patch) | |
tree | 8c43d997c471b171f8929fee681c1650c0f06c57 /drivers/tty/pty.c | |
parent | tty: Simplify tty_release() state checks (diff) | |
download | linux-2aff5e2bc62db43e05c814461a08aff0fc2b7fe5.tar.xz linux-2aff5e2bc62db43e05c814461a08aff0fc2b7fe5.zip |
tty: Change tty lock order to master->slave
When releasing the master pty, the slave pty also needs to be locked
to prevent concurrent tty count changes for the slave pty and to
ensure that only one parallel master and slave release observe the
final close, and proceed to destruct the pty pair. Conversely, when
releasing the slave pty, locking the master pty is not necessary
(since the master's state can be inferred by the slave tty count).
Introduce tty_lock_slave()/tty_unlock_slave() which acquires/releases
the tty lock of the slave pty. Remove tty_lock_pair()/tty_unlock_pair().
Dropping the tty_lock is no longer required to re-establish a stable
lock order.
Reviewed-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/pty.c')
0 files changed, 0 insertions, 0 deletions