[RHEL7,COMMIT] ve: fix container stopped state check

Submitted by Konstantin Khorenko on Dec. 7, 2017, 12:02 p.m.

Details

Message ID 201712071202.vB7C2oJr031545@finist_ce7.work
State New
Series "ve: fix container stopped state check"
Headers show

Commit Message

Konstantin Khorenko Dec. 7, 2017, 12:02 p.m.
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@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@virtuozzo.com>
---
 kernel/ve/ve.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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");