Skip to contentSkip to conversation

cgroup: remove extra cgroup_migrate_finish() call

PATCH Applied Shakeel Butt 3 participants 3 messages Apr 3, 2019 – Apr 4, 2019 cgroup

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cgroup: remove extra cgroup_migrate_finish() call

The callers of cgroup_migrate_prepare_dst() correctly call cgroup_migrate_finish() for success and failure cases both. No need to call it in cgroup_migrate_prepare_dst() in failure case.

---
 kernel/cgroup/cgroup.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
kernel/cgroup/cgroup.c +1 -4
index 3f2b4bde0f9c..f219c195a9a5 100644
@@ -2602,7 +2602,7 @@ int cgroup_migrate_prepare_dst(struct cgroup_mgctx *mgctx)
 
 		dst_cset = find_css_set(src_cset, src_cset->mg_dst_cgrp);
 		if (!dst_cset)
-			goto err;
+			return -ENOMEM;
 
 		WARN_ON_ONCE(src_cset->mg_dst_cset || dst_cset->mg_dst_cset);
 
@@ -2634,9 +2634,6 @@ int cgroup_migrate_prepare_dst(struct cgroup_mgctx *mgctx)
 	}
 
 	return 0;
-err:
-	cgroup_migrate_finish(mgctx);
-	return -ENOMEM;
 }
 
 /**
Signature · 1 line
2.21.0.392.gf8f6787159e-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Shakeel Butt

The callers of cgroup_migrate_prepare_dst() correctly call cgroup_migrate_finish() for success and failure cases both. No need to call it in cgroup_migrate_prepare_dst() in failure case.

Calling cgroup_migrate_finish multiple times is a no-op, so thankfully it wasn't causing any problems. Looks good to me.

maintainer Applied
#2 lore raw
In reply to Shakeel Butt
Quoted 5 lines · Shakeel Butt

The callers of cgroup_migrate_prepare_dst() correctly call cgroup_migrate_finish() for success and failure cases both. No need to call it in cgroup_migrate_prepare_dst() in failure case.

Applied to cgroup/for-5.2.

Thanks, Shakeel.

Signature · 1 line
tejun