Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 494c1eac authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman
Browse files

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: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 37b16457
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -1710,6 +1710,7 @@ int tty_release(struct inode *inode, struct file *filp)
	int	idx;
	int	idx;
	char	buf[64];
	char	buf[64];
	long	timeout = 0;
	long	timeout = 0;
	int	once = 1;


	if (tty_paranoia_check(tty, inode, __func__))
	if (tty_paranoia_check(tty, inode, __func__))
		return 0;
		return 0;
@@ -1790,8 +1791,11 @@ int tty_release(struct inode *inode, struct file *filp)
		if (!do_sleep)
		if (!do_sleep)
			break;
			break;


		if (once) {
			once = 0;
			printk(KERN_WARNING "%s: %s: read/write wait queue active!\n",
			printk(KERN_WARNING "%s: %s: read/write wait queue active!\n",
			       __func__, tty_name(tty, buf));
			       __func__, tty_name(tty, buf));
		}
		tty_unlock_pair(tty, o_tty);
		tty_unlock_pair(tty, o_tty);
		mutex_unlock(&tty_mutex);
		mutex_unlock(&tty_mutex);
		schedule_timeout_killable(timeout);
		schedule_timeout_killable(timeout);