[Devel] [PATCH RHEL7 COMMIT] ve/tty: call device_destroy_namespace only for containerized drivers

Konstantin Khorenko khorenko at virtuozzo.com
Mon Jul 6 06:34:33 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.24
------>
commit 79fe58e2cb26c691c0bc5b40d2a1c1894af6932d
Author: Andrew Vagin <avagin at openvz.org>
Date:   Mon Jul 6 17:34:33 2015 +0400

    ve/tty: call device_destroy_namespace only for containerized drivers
    
    Containerized drivers save ve in drvdata, but other drivers can use
    drvdata for own needs. For example, uart_add_one_port calls
    tty_port_register_device_attr with non-zero drvdata.
    
    https://jira.sw.ru/browse/PSBM-33971
    
    Signed-off-by: Andrew Vagin <avagin at openvz.org>
    Acked-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 drivers/tty/tty_io.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 13f2430..1da7df3 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -3257,13 +3257,14 @@ EXPORT_SYMBOL_GPL(tty_register_device_attr);
 void tty_unregister_device(struct tty_driver *driver, unsigned index)
 {
 #ifdef CONFIG_VE
-	device_destroy_namespace(tty_class,
-		MKDEV(driver->major, driver->minor_start) + index,
-		driver->ve);
-#else
-	device_destroy(tty_class,
-		MKDEV(driver->major, driver->minor_start) + index);
+	if (driver->flags & TTY_DRIVER_CONTAINERIZED) {
+		device_destroy_namespace(tty_class,
+			MKDEV(driver->major, driver->minor_start) + index,
+			driver->ve);
+	} else
 #endif
+		device_destroy(tty_class,
+			MKDEV(driver->major, driver->minor_start) + index);
 	if (!(driver->flags & TTY_DRIVER_DYNAMIC_ALLOC))
 		tty_cdev_del(driver, &driver->cdevs[index]);
 }



More information about the Devel mailing list