aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2014-10-16 13:54:36 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-05 19:14:09 -0500
commit494c1eac7e73f719af9d474a96ec8494c33efd6a (patch)
treea89baeb96c6d5ccdd295ac246d0f21f7869d0c75
parent37b164578826406a173ca7c20d9ba7430134d23e (diff)
tty: Prevent "read/write wait queue active!" log flooding
Only print one warning when a task is on the read_wait or write_wait wait queue at final tty release. Cc: <stable@vger.kernel.org> # 3.4.x+ Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/tty_io.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 4021c10d9908..0508a1d8e4cd 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1710,6 +1710,7 @@ int tty_release(struct inode *inode, struct file *filp)
1710 int idx; 1710 int idx;
1711 char buf[64]; 1711 char buf[64];
1712 long timeout = 0; 1712 long timeout = 0;
1713 int once = 1;
1713 1714
1714 if (tty_paranoia_check(tty, inode, __func__)) 1715 if (tty_paranoia_check(tty, inode, __func__))
1715 return 0; 1716 return 0;
@@ -1790,8 +1791,11 @@ int tty_release(struct inode *inode, struct file *filp)
1790 if (!do_sleep) 1791 if (!do_sleep)
1791 break; 1792 break;
1792 1793
1793 printk(KERN_WARNING "%s: %s: read/write wait queue active!\n", 1794 if (once) {
1794 __func__, tty_name(tty, buf)); 1795 once = 0;
1796 printk(KERN_WARNING "%s: %s: read/write wait queue active!\n",
1797 __func__, tty_name(tty, buf));
1798 }
1795 tty_unlock_pair(tty, o_tty); 1799 tty_unlock_pair(tty, o_tty);
1796 mutex_unlock(&tty_mutex); 1800 mutex_unlock(&tty_mutex);
1797 schedule_timeout_killable(timeout); 1801 schedule_timeout_killable(timeout);