[Devel,RHEL7,COMMIT] Revert "tty: Fix task hang if one of peers is sitting in read"

Submitted by Konstantin Khorenko on Aug. 15, 2016, 10:07 a.m.

Details

Message ID 201608151007.u7FA73I3023392@finist_cl7.x64_64.work.ct
State New
Headers show

Patch hide | download patch | download mbox

diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index 4c82aaa..fd2b20d 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -685,7 +685,7 @@  void tty_ldisc_hangup(struct tty_struct *tty)
 	 *
 	 * Avoid racing set_ldisc or tty_ldisc_release
 	 */
-	tty_ldisc_lock(tty, MAX_SCHEDULE_TIMEOUT);
+	tty_ldisc_lock_pair(tty, tty->link);
 
 	if (tty->ldisc) {
 
@@ -707,7 +707,7 @@  void tty_ldisc_hangup(struct tty_struct *tty)
 			WARN_ON(tty_ldisc_open(tty, tty->ldisc));
 		}
 	}
-	tty_ldisc_unlock(tty);
+	tty_ldisc_enable_pair(tty, tty->link);
 	if (reset)
 		tty_reset_termios(tty);