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

Konstantin Khorenko khorenko at virtuozzo.com
Mon Aug 15 03:07:03 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.1
------>
commit 9539e4b2c5eee61f4b7c365be6df5ac2c8d8c770
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Mon Aug 15 14:04:52 2016 +0400

    Revert "tty: Fix task hang if one of peers is sitting in read"
    
    This reverts commit ae93b8e96941c9ad53299f87d5eb0bff9e573d81.
    
    In vz7.16.2 (based on 3.10.0-327.22.2.el7) we have a commit
    
    commit fb7d3bebfd7b55c694b71be154302c282a9285c7
    Author: Cyrill Gorcunov <gorcunov at virtuozzo.com>
    Date:   Thu Jan 28 23:02:43 2016 +0400
    
        tty: Fix task hang if one of peers is sitting in read
    
    In 3.10.0-327.28.2.el7 RedHat ported 2 patches from mainsteam:
    ms commits:
    c8483bc tty: Invert tty_lock/ldisc_sem lock order
    3ee175d tty: Don't hold tty_lock for ldisc release
    
    RHEL7 changelog lines:
    - [tty] Invert tty_lock/ldisc_sem lock order (Herton R. Krzesinski) [1336823 1327403]
    - [tty] Don't hold tty_lock for ldisc release (Herton R. Krzesinski) [1336823 1327403]
    
    And now we are dropping left hunks from the original patch,
    they are not needed any more.
    
    https://jira.sw.ru/browse/PSBM-50737
    
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
    Acked-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 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 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);
 


More information about the Devel mailing list