[Devel,rh7] tty: Fix task hang if one of peers is sitting in read

Submitted by Kirill Gorkunov on Aug. 24, 2016, 11:54 a.m.

Details

Message ID 20160824115432.GA3945@uranus
State New
Series "tty: Fix task hang if one of peers is sitting in read"
Headers show

Commit Message

Kirill Gorkunov Aug. 24, 2016, 11:54 a.m.
We reverted the former fix (ae93b8e96941c9ad) in commit 9539e4b2c5eee61f
but the changes ported by rh team eventually are still not enough.
So bring ae93b8e96941c9ad back.

https://jira.sw.ru/browse/PSBM-51273

Signed-off-by: Cyrill Gorcunov <gorcunov@virtuozzo.com>
CC: Igor Sukhih <igor@virtuozzo.com>
CC: Vladimir Davydov <vdavydov@virtuozzo.com>
CC: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 drivers/tty/tty_ldisc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

Index: linux-pcs7.git/drivers/tty/tty_ldisc.c
===================================================================
--- linux-pcs7.git.orig/drivers/tty/tty_ldisc.c
+++ linux-pcs7.git/drivers/tty/tty_ldisc.c
@@ -685,7 +685,7 @@  void tty_ldisc_hangup(struct tty_struct
 	 *
 	 * Avoid racing set_ldisc or tty_ldisc_release
 	 */
-	tty_ldisc_lock_pair(tty, tty->link);
+	tty_ldisc_lock(tty, MAX_SCHEDULE_TIMEOUT);
 
 	if (tty->ldisc) {
 
@@ -707,7 +707,7 @@  void tty_ldisc_hangup(struct tty_struct
 			WARN_ON(tty_ldisc_open(tty, tty->ldisc));
 		}
 	}
-	tty_ldisc_enable_pair(tty, tty->link);
+	tty_ldisc_unlock(tty);
 	if (reset)
 		tty_reset_termios(tty);