[Devel,libvzctl,2/2] env_create: created root run path in VE#0 context

Submitted by Stanislav Kinsburskiy on July 28, 2017, 8:43 a.m.

Details

Message ID 20170728084325.7659.27839.stgit@skinsbursky-vz7.qa.sw.ru
State New
Series "env_create: create CT run root in VE#0 context"
Headers show

Commit Message

Stanislav Kinsburskiy July 28, 2017, 8:43 a.m.
Currently it's created as a part of first CT pid file. And this file is
created in VE#X context. Which in turn leads to "leaked" dentry.
Well, it's not leaked, but rather anoying, because holds VE#X slabs and
visible in /sys like this after CT stop:

/sys/kernel/slab/:atA-0000192/cgroup/dentry(5:102)

This patch fixes it by explicitly created runt root dentry in VE#0

Found in scope of https://jira.sw.ru/browse/PSBM-65033

Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
---
 lib/env_nsops.c |    4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/lib/env_nsops.c b/lib/env_nsops.c
index 4ecd46e..d7ae0bf 100644
--- a/lib/env_nsops.c
+++ b/lib/env_nsops.c
@@ -739,6 +739,10 @@  static int do_env_create(struct vzctl_env_handle *h, struct start_param *param)
 	act.sa_flags = SA_NOCLDSTOP;
 	sigaction(SIGPIPE, &act, NULL);
 
+	ret = create_ve_run_dir();
+	if (ret)
+		return ret;
+
 	ret = create_cgroup(h, flags);
 	if (ret)
 		return ret;