aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/n_tty.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2013-11-07 13:59:46 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-25 11:35:00 -0500
commit42458f41d08f0873299e830464c1232a6839297d (patch)
tree84d05de2d6f10dca657f2b69fdba0863d7106f43 /drivers/tty/n_tty.c
parent6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae (diff)
n_tty: Ensure reader restarts worker for next reader
A departing reader must restart a flush_to_ldisc() worker _before_ the next reader enters the read loop; this is to avoid the new reader concluding no more i/o is available and prematurely exiting, when the old reader simply hasn't re-started the worker yet. Cc: stable <stable@vger.kernel.org> # 3.12 Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/n_tty.c')
-rw-r--r--drivers/tty/n_tty.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 7cdd1eb9406c..a2b70c97391f 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -2243,6 +2243,9 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
2243 if (time) 2243 if (time)
2244 timeout = time; 2244 timeout = time;
2245 } 2245 }
2246 n_tty_set_room(tty);
2247 up_read(&tty->termios_rwsem);
2248
2246 mutex_unlock(&ldata->atomic_read_lock); 2249 mutex_unlock(&ldata->atomic_read_lock);
2247 remove_wait_queue(&tty->read_wait, &wait); 2250 remove_wait_queue(&tty->read_wait, &wait);
2248 2251
@@ -2253,8 +2256,6 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
2253 if (b - buf) 2256 if (b - buf)
2254 retval = b - buf; 2257 retval = b - buf;
2255 2258
2256 n_tty_set_room(tty);
2257 up_read(&tty->termios_rwsem);
2258 return retval; 2259 return retval;
2259} 2260}
2260 2261