diff options
-rw-r--r-- | kernel/cgroup.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 358e77564e6f..1a06be61dcd0 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -2472,10 +2472,7 @@ static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry) | |||
2472 | mutex_unlock(&cgroup_mutex); | 2472 | mutex_unlock(&cgroup_mutex); |
2473 | return -EBUSY; | 2473 | return -EBUSY; |
2474 | } | 2474 | } |
2475 | 2475 | mutex_unlock(&cgroup_mutex); | |
2476 | parent = cgrp->parent; | ||
2477 | root = cgrp->root; | ||
2478 | sb = root->sb; | ||
2479 | 2476 | ||
2480 | /* | 2477 | /* |
2481 | * Call pre_destroy handlers of subsys. Notify subsystems | 2478 | * Call pre_destroy handlers of subsys. Notify subsystems |
@@ -2483,7 +2480,14 @@ static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry) | |||
2483 | */ | 2480 | */ |
2484 | cgroup_call_pre_destroy(cgrp); | 2481 | cgroup_call_pre_destroy(cgrp); |
2485 | 2482 | ||
2486 | if (cgroup_has_css_refs(cgrp)) { | 2483 | mutex_lock(&cgroup_mutex); |
2484 | parent = cgrp->parent; | ||
2485 | root = cgrp->root; | ||
2486 | sb = root->sb; | ||
2487 | |||
2488 | if (atomic_read(&cgrp->count) | ||
2489 | || !list_empty(&cgrp->children) | ||
2490 | || cgroup_has_css_refs(cgrp)) { | ||
2487 | mutex_unlock(&cgroup_mutex); | 2491 | mutex_unlock(&cgroup_mutex); |
2488 | return -EBUSY; | 2492 | return -EBUSY; |
2489 | } | 2493 | } |