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

Konstantin Khorenko khorenko at virtuozzo.com
Thu Dec 7 15:02:50 MSK 2017


The commit is pushed to "branch-rh7-3.10.0-693.11.1.vz7.39.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.11.1.vz7.39.1
------>
commit d148fd97e03af83d7247812550333b78181c4479
Author: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
Date:   Thu Dec 7 15:02:50 2017 +0300

    ve: fix container stopped state check
    
    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 b0188c3f71f9..c62851638c69 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