[Devel] [PATCH hci-8.1 1/4] ve: Remove STOPPED state
Vladimir Riabchun
vladimir.riabchun at virtuozzo.com
Thu Oct 22 18:05:25 MSK 2026
We really don't want to reuse VE after its stop.
Some resources from the old run can reference this CT, so new
start may see leftovers.
Fix this by transitioning from STOPPING to DEAD directly.
https://virtuozzo.atlassian.net/browse/VSTOR-142405
Signed-off-by: Vladimir Riabchun <vladimir.riabchun at virtuozzo.com>
---
include/linux/ve.h | 3 +--
kernel/ve/ve.c | 6 ++----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/include/linux/ve.h b/include/linux/ve.h
index a400d21593b2..717567775f58 100644
--- a/include/linux/ve.h
+++ b/include/linux/ve.h
@@ -40,8 +40,7 @@ struct vfsmount;
#define VE_STATE_STARTING 0
#define VE_STATE_RUNNING 1
#define VE_STATE_STOPPING 2
-#define VE_STATE_STOPPED 3
-#define VE_STATE_DEAD 4
+#define VE_STATE_DEAD 3
#define VE_IS_RUNNING(ve) ((ve)->state == VE_STATE_RUNNING)
diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index 579628a8a310..d74f74ca958a 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -604,7 +604,7 @@ static int ve_start_container(struct ve_struct *ve)
err_mark_ve:
ve_list_del(ve);
err_list:
- ve_set_state(ve, VE_STATE_STOPPED);
+ ve_set_state(ve, VE_STATE_DEAD);
ve_drop_context(ve);
return err;
}
@@ -680,7 +680,7 @@ void ve_exit_ns(struct pid_namespace *pid_ns)
ve_hook_iterate_fini(VE_SS_CHAIN, ve);
ve_list_del(ve);
ve_drop_context(ve);
- ve_set_state(ve, VE_STATE_STOPPED);
+ ve_set_state(ve, VE_STATE_DEAD);
up_write(&ve->op_sem);
printk(KERN_INFO "CT: %s: stopped\n", ve_name(ve));
@@ -935,7 +935,6 @@ static void ve_destroy(struct cgroup_subsys_state *css)
ve_free_vdso(ve);
mntput(ve->devtmpfs_mnt);
free_percpu(ve->sched_lat_ve.cur);
- ve_set_state(ve, VE_STATE_DEAD);
kmem_cache_free(ve_cachep, ve);
}
@@ -955,7 +954,6 @@ static int ve_state_show(struct seq_file *sf, void *v)
case VE_STATE_STOPPING:
seq_puts(sf, "STOPPING");
break;
- case VE_STATE_STOPPED:
case VE_STATE_DEAD:
seq_puts(sf, "STOPPED");
break;
--
2.52.0
More information about the Devel
mailing list