[Devel] [PATCH RH8/9] vtty: fix lockdep annotation

Cyrill Gorcunov gorcunov at gmail.com
Mon Dec 20 11:11:45 MSK 2021


From: Cyrill Gorcunov <gorcunov at virtuozzo.com>

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>
---
Kostya, the patch is for vz7 sources but it is needed for
vz9 as well and applies without problem thus merge it there
as well.

 drivers/tty/pty.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: vzkernel7/drivers/tty/pty.c
===================================================================
--- vzkernel7.orig/drivers/tty/pty.c
+++ vzkernel7/drivers/tty/pty.c
@@ -1054,6 +1054,7 @@ static int vtty_install(struct tty_drive
 	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 i
 		}
 		tty->count--;
 		tty_unlock(tty);
-		tty_set_lock_subclass(tty);
 		tty = tty->link;
 	}
 


More information about the Devel mailing list