Skip to contentSkip to conversation

tty: Prevent "read/write wait queue active!" log flooding

PATCH New Peter Hurley 1 participant 1 message Oct 16, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/tty/tty_io.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/tty/tty_io.c +6 -2
index 1019025..cf7c9b8 100644
@@ -1709,6 +1709,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;
@@ -1789,8 +1790,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",
-				__func__, tty_name(tty, buf));
+		if (once) {
+			once = 0;
+			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_timeout_killable(timeout);
Signature · 1 line
2.1.1