Commit 0911261d authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman

tty: Don't take tty_mutex for tty count changes

Holding tty_mutex is no longer required to serialize changes to
the tty_count or to prevent concurrent opens of closing ttys;
tty_lock() is sufficient.
Reviewed-by: default avatarAlan Cox <>
Signed-off-by: default avatarPeter Hurley <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 04980706
......@@ -1804,10 +1804,6 @@ int tty_release(struct inode *inode, struct file *filp)
* each iteration we avoid any problems.
while (1) {
/* Guard against races with tty->count changes elsewhere and
opens on /dev/tty */
tty_lock_pair(tty, o_tty);
tty_closing = tty->count <= 1;
o_tty_closing = o_tty &&
......@@ -1840,7 +1836,6 @@ int tty_release(struct inode *inode, struct file *filp)
printk(KERN_WARNING "%s: %s: read/write wait queue active!\n",
__func__, tty_name(tty, buf));
tty_unlock_pair(tty, o_tty);
......@@ -1891,7 +1886,6 @@ int tty_release(struct inode *inode, struct file *filp)
tty_unlock_pair(tty, o_tty);
/* At this point, the tty->count == 0 should ensure a dead tty
cannot be re-opened by a racing opener */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment