Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1305475

[PATCH v2 6/7] n_tty: Remove tty count checks from unthrottle

From Peter Hurley <peter@hurleysoftware.com>
Newsgroups linux.kernel
Subject [PATCH v2 6/7] n_tty: Remove tty count checks from unthrottle
Date 2016-01-10 06:50 +0100
Message-ID <qPh33-8nj-15@gated-at.bofh.it> (permalink)
References <qF0Gd-8bC-3@gated-at.bofh.it> <qPh33-8nj-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Since n_tty_check_unthrottle() is only called from n_tty_read()
which only originates from a userspace read(), the tty count cannot
be 0; the read() guarantees the file descriptor has not yet been
released.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
 drivers/tty/n_tty.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 086fd99..5ae661c 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -261,8 +261,6 @@ static void n_tty_check_unthrottle(struct tty_struct *tty)
 	if (tty->driver->type == TTY_DRIVER_TYPE_PTY) {
 		if (chars_in_buffer(tty) > TTY_THRESHOLD_UNTHROTTLE)
 			return;
-		if (!tty->count)
-			return;
 		n_tty_kick_worker(tty);
 		tty_wakeup(tty->link);
 		return;
@@ -281,8 +279,6 @@ static void n_tty_check_unthrottle(struct tty_struct *tty)
 		tty_set_flow_change(tty, TTY_UNTHROTTLE_SAFE);
 		if (chars_in_buffer(tty) > TTY_THRESHOLD_UNTHROTTLE)
 			break;
-		if (!tty->count)
-			break;
 		n_tty_kick_worker(tty);
 		unthrottled = tty_unthrottle_safe(tty);
 		if (!unthrottled)
-- 
2.7.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/7] More n_tty fixes Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:50 +0100
  [PATCH v2 2/7] tty, n_tty: Remove fasync() ldisc notification Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:50 +0100
  [PATCH v2 5/7] n_tty: Fix stuck write wakeup Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:50 +0100
  [PATCH v2 3/7] tty: Add fasync() hung up file operation Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:50 +0100
  [PATCH v2 6/7] n_tty: Remove tty count checks from unthrottle Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:50 +0100
  [PATCH v2 4/7] tty: Fix ioctl(FIOASYNC) on hungup file Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:50 +0100
  [PATCH v2 7/7] tty: n_tty: fix SIGIO for output Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:50 +0100

csiph-web