diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2014-10-16 13:54:36 -0400 |
---|---|---|
committer | Zefan Li <lizefan@huawei.com> | 2015-02-02 17:05:15 +0800 |
commit | 871518e986137e72b3ad20e5b3fd7093cda69bbf (patch) | |
tree | 8dda4e4e09eb263858a03b1bcc7533048296bf90 | |
parent | 26bc3aa52a38602cc5a4430571d90e158430573b (diff) |
tty: Prevent "read/write wait queue active!" log flooding
commit 494c1eac7e73f719af9d474a96ec8494c33efd6a upstream.
Only print one warning when a task is on the read_wait or write_wait
wait queue at final tty release.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[lizf: Backported to 3.4: adjust context]
Signed-off-by: Zefan Li <lizefan@huawei.com>
-rw-r--r-- | drivers/tty/tty_io.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 2d66beed3e1f..a07eb4c068a0 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -1634,6 +1634,7 @@ int tty_release(struct inode *inode, struct file *filp) int idx; char buf[64]; long timeout = 0; + int once = 1; if (tty_paranoia_check(tty, inode, __func__)) return 0; @@ -1714,8 +1715,11 @@ int tty_release(struct inode *inode, struct file *filp) if (!do_sleep) break; - printk(KERN_WARNING "%s: %s: read/write wait queue active!\n", + if (once) { + once = 0; + printk(KERN_WARNING "%s: %s: read/write wait queue active!\n", __func__, tty_name(tty, buf)); + } tty_unlock(); mutex_unlock(&tty_mutex); schedule_timeout_killable(timeout); |