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

Vladimir Davydov vdavydov at virtuozzo.com
Wed Aug 24 05:01:42 PDT 2016


The commit is pushed to "branch-rh7-3.10.0-327.28.2.vz7.17.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.28.2.vz7.17.3
------>
commit a7fb20c4cd83a1add67efe3edaa8500cc6edc6d1
Author: Cyrill Gorcunov <gorcunov at virtuozzo.com>
Date:   Wed Aug 24 16:01:42 2016 +0400

    tty: Fix task hang if one of peers is sitting in read
    
    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 at virtuozzo.com>
    CC: Igor Sukhih <igor at virtuozzo.com>
    CC: Vladimir Davydov <vdavydov at virtuozzo.com>
    CC: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 drivers/tty/tty_ldisc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index fd2b20d6af80..4c82aaad8566 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_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 *tty)
 			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);
 


More information about the Devel mailing list