[Devel] [PATCH RHEL9 COMMIT] vtty: lockdep -- adjust slave peer names

Konstantin Khorenko khorenko at virtuozzo.com
Thu Jan 27 17:15:08 MSK 2022


The commit is pushed to "branch-rh9-5.14.0-4.vz9.12.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-4.vz9.12.2
------>
commit 6af09482656a05ade8428f41c55a4282f1ab2eb2
Author: Cyrill Gorcunov <gorcunov at virtuozzo.com>
Date:   Thu Jan 27 17:15:08 2022 +0300

    vtty: lockdep -- adjust slave peer names
    
    The lockdep's helper lockdep_set_subclass() uses first
    argument as a key's name and since vtty peers are always
    coming in pairs the engine relies that slave's peer locking
    primitives are passed with different name. For this sake
    lets rename @tty to @o_tty just like it is done in pty
    code.
    
    https://jira.sw.ru/browse/PSBM-137884
    
    Fixes: 20422df00bfe ("vtty: fix slave peer lockdep annotation")
    Signed-off-by: Cyrill Gorcunov <gorcunov at virtuozzo.com>
---
 drivers/tty/pty.c  | 6 +++---
 include/linux/ve.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index c9151c12480c..bed018e03d02 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -1022,13 +1022,13 @@ static int __init vtty_init(void)
 }
 
 void vtty_alloc_tty_struct(const struct tty_driver *driver,
-			   struct tty_struct *tty)
+			   struct tty_struct *o_tty)
 {
 	if (driver != vttys_driver)
 		return;
 
-	tty_set_lock_subclass(tty);
-	lockdep_set_subclass(&tty->termios_rwsem, TTY_LOCK_SLAVE);
+	tty_set_lock_subclass(o_tty);
+	lockdep_set_subclass(&o_tty->termios_rwsem, TTY_LOCK_SLAVE);
 }
 
 int vtty_open_master(envid_t veid, int idx)
diff --git a/include/linux/ve.h b/include/linux/ve.h
index ca5cc31a0910..dee08fbc34c0 100644
--- a/include/linux/ve.h
+++ b/include/linux/ve.h
@@ -208,7 +208,7 @@ extern void vtty_release(struct tty_struct *tty, struct tty_struct *o_tty,
 			int *tty_closing, int *o_tty_closing);
 extern bool vtty_is_master(struct tty_struct *tty);
 extern void vtty_alloc_tty_struct(const struct tty_driver *driver,
-				  struct tty_struct *tty);
+				  struct tty_struct *o_tty);
 #endif /* CONFIG_TTY */
 
 extern struct cgroup *cgroup_ve_root1(struct cgroup *cgrp);


More information about the Devel mailing list