[CRIU] [PATCH 3/3] cgroup: we won't walk the same path for the same hierarchy twice in add_cgroup(), so BUG() it

Ivan Shapovalov intelfx at intelfx.name
Fri Feb 19 07:05:51 PST 2016


Signed-off-by: Ivan Shapovalov <intelfx at intelfx.name>
---
 criu/cgroup.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/criu/cgroup.c b/criu/cgroup.c
index c699b6b..735f749 100644
--- a/criu/cgroup.c
+++ b/criu/cgroup.c
@@ -514,10 +514,6 @@ static int add_cgroup(const char *fpath, const struct stat *sb, int typeflag)
 		mtype = find_dir(ncd->path, &current_controller->heads, &match);
 
 		switch (mtype) {
-		/* ignore co-mounted cgroups */
-		case EXACT_MATCH:
-			exit_code = 0;
-			goto out;
 		case PARENT_MATCH:
 			list_add_tail(&ncd->siblings, &match->children);
 			match->n_children++;
@@ -526,6 +522,8 @@ static int add_cgroup(const char *fpath, const struct stat *sb, int typeflag)
 			list_add_tail(&ncd->siblings, &current_controller->heads);
 			current_controller->n_heads++;
 			break;
+		/* the same hierarchy won't be walked twice for a single process */
+		case EXACT_MATCH:
 		default:
 			BUG();
 		}
-- 
2.7.1



More information about the CRIU mailing list