diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2013-11-07 13:59:46 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-04 11:05:41 -0800 |
commit | b4a1a4cc91f62441214ae75aff9a2834bc7f5c10 (patch) | |
tree | 463ffc5a5e3b2def0a68d99584484e79408d22bc /drivers/tty/n_tty.c | |
parent | a4839c4c246a66ec0bb40aaa78aeeca4fd38f252 (diff) |
n_tty: Ensure reader restarts worker for next reader
commit 42458f41d08f0873299e830464c1232a6839297d upstream.
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.
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.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index f3ef372876e..ff582933e94 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -2253,6 +2253,9 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, if (time) timeout = time; } + n_tty_set_room(tty); + up_read(&tty->termios_rwsem); + mutex_unlock(&ldata->atomic_read_lock); remove_wait_queue(&tty->read_wait, &wait); @@ -2263,8 +2266,6 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, if (b - buf) retval = b - buf; - n_tty_set_room(tty); - up_read(&tty->termios_rwsem); return retval; } |