[CRIU] [PATCH] cgroup: call fini_cgroup() on error paths

Andrey Vagin avagin at openvz.org
Wed Mar 25 05:42:02 PDT 2015


Currenlty if criu fails before prepare_cgroup_properties(),
cgyard isn't umounted.

I think it's déjà vu, but it isn't :)

commit 28b0e16d730ec21a515b2686961c6312816c47f3
Author: Andrew Vagin <avagin at openvz.org>
Date:   Mon Aug 25 14:29:00 2014 +0400

    cgroup: call fin_cgroup() on error paths

Cc: Tycho Andersen <tycho.andersen at canonical.com>
Cc: Saied Kazemi <saied at google.com>
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 cr-restore.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/cr-restore.c b/cr-restore.c
index 4d9e078..823bf15 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -1850,10 +1850,8 @@ static int restore_root_task(struct pstree_item *init)
 
 	write_stats(RESTORE_STATS);
 
-	if (!opts.restore_detach && !opts.exec_cmd) {
-		fini_cgroup();
+	if (!opts.restore_detach && !opts.exec_cmd)
 		wait(NULL);
-	}
 
 	return 0;
 
@@ -1875,6 +1873,7 @@ out_kill:
 	}
 
 out:
+	fini_cgroup();
 	stop_usernsd();
 	__restore_switch_stage(CR_STATE_FAIL);
 	pr_err("Restoring FAILED.\n");
-- 
2.1.0



More information about the CRIU mailing list