[Devel] [PATCH 13/13] drivers/core/sysfs: respect ns when removing sys dev link

Alexander Mikhalitsyn alexander.mikhalitsyn at virtuozzo.com
Wed Apr 14 10:58:00 MSK 2021


From: Vladimir Davydov <vdavydov at parallels.com>

There is two methods to remove sysfs links - sysfs_delete_link and
sysfs_remove_link. The difference between them is that one is ns-aware
while the other isn't. Since we want to create per-ve ttys using
device_add/device_del we have to use ns-aware one, otherwise we'll get
EEXIST error on ve start.

https://jira.sw.ru/browse/PSBM-25801

Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
Acked-by: Stanislav Kinsbursky <skinsbursky at parallels.com>

===

VZ 8 rebase part https://jira.sw.ru/browse/PSBM-127782

Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn at virtuozzo.com>
---
 drivers/base/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 426b3d4430ff..1e692e0639a8 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1824,7 +1824,7 @@ static void device_remove_sys_dev_entry(struct device *dev)
 
 	if (kobj) {
 		format_dev_t(devt_str, dev->devt);
-		sysfs_remove_link(kobj, devt_str);
+		sysfs_delete_link(kobj, &dev->kobj, devt_str);
 	}
 }
 
-- 
2.28.0



More information about the Devel mailing list