summaryrefslogtreecommitdiff
path: root/drivers/tty/tty_io.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2014-11-05 20:12:53 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-06 05:30:43 +0300
commit0911261d4cb614ef6900cd2906be2c61a87f43ff (patch)
tree0d69b4db079286579460737708fbe732f032a24b /drivers/tty/tty_io.c
parent04980706c8febe41ec598116b174bd3a2dc82355 (diff)
downloadlinux-0911261d4cb614ef6900cd2906be2c61a87f43ff.tar.xz
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: 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/tty_io.c')
-rw-r--r--drivers/tty/tty_io.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index ea8c6cae8d12..e59de81c39a9 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -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 */
-
- mutex_lock(&tty_mutex);
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);
- mutex_unlock(&tty_mutex);
schedule();
}
@@ -1891,7 +1886,6 @@ int tty_release(struct inode *inode, struct file *filp)
read_unlock(&tasklist_lock);
}
- mutex_unlock(&tty_mutex);
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 */