[Devel] [PATCH RHEL7 COMMIT] vtty: fix lockdep annotation

Vasily Averin vvs at virtuozzo.com
Thu Dec 30 16:57:02 MSK 2021


The commit is pushed to "branch-rh7-3.10.0-1160.42.2.vz7.184.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.42.2.vz7.184.7
------>
commit 24c347049ea3994151b2e7ef02cc02097d2ce1b1
Author: Cyrill Gorcunov <gorcunov at virtuozzo.com>
Date:   Thu Dec 30 16:56:54 2021 +0300

    vtty: fix lockdep annotation
    
    When we create a new vtty instance we should annotate the
    @tty->legacy_mutex at moment where the lock is taken not
    after. Otherwise lockdep engine complains about possible
    circular locking issue.
    
    https://jira.sw.ru/browse/PSBM-136773
    
    Signed-off-by: Cyrill Gorcunov <gorcunov at virtuozzo.com>
---
 drivers/tty/pty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 17c5f51..5a2fe20 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -1054,6 +1054,7 @@ static int vtty_install(struct tty_driver *driver, struct tty_struct *tty)
 	tty->link = peer;
 	peer->link = tty;
 
+	tty_set_lock_subclass(tty);
 	vtty_map_set(map, tty);
 	return 0;
 
@@ -1307,7 +1308,6 @@ int vtty_open_master(envid_t veid, int idx)
 		}
 		tty->count--;
 		tty_unlock(tty);
-		tty_set_lock_subclass(tty);
 		tty = tty->link;
 	}
 


More information about the Devel mailing list