[Devel] [PATCH] ve: fix container stopped state check

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Fri Dec 1 14:22:47 MSK 2017


Checking for empty cgroup is not correct, because init process leaves cgroup
early in do_exit.
This leads to a situation, when container is treated as stopped but its
resources (VEIP for instance) are not yet released.
Which in turn leads to container restart failure due to non-releases VEIP
address.

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

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 kernel/ve/ve.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index b0188c3..c628516 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -846,7 +846,7 @@ static int ve_state_read(struct cgroup *cg, struct cftype *cft,
 
 	if (ve->is_running)
 		seq_puts(m, "RUNNING");
-	else if (!nr_threads_ve(ve))
+	else if (!ve->init_task)
 		seq_puts(m, "STOPPED");
 	else if (ve->ve_ns)
 		seq_puts(m, "STOPPING");



More information about the Devel mailing list