aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2008-12-04 01:16:36 -0500
committerJames Morris <jmorris@namei.org>2008-12-04 01:16:36 -0500
commitec98ce480ada787f2cfbd696980ff3564415505b (patch)
tree1a4d644b38f9f1e4b4e086fde0b195df4a92cf84 /kernel/cgroup.c
parent3496f92beb9aa99ef21fccc154a36c7698e9c538 (diff)
parentfeaf3848a813a106f163013af6fcf6c4bfec92d9 (diff)
Merge branch 'master' into next
Conflicts: fs/nfsd/nfs4recover.c Manually fixed above to use new creds API functions, e.g. nfs4_save_creds(). Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 8fe8c0cb137b..dee025f2f286 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2042,10 +2042,13 @@ int cgroupstats_build(struct cgroupstats *stats, struct dentry *dentry)
2042 struct cgroup *cgrp; 2042 struct cgroup *cgrp;
2043 struct cgroup_iter it; 2043 struct cgroup_iter it;
2044 struct task_struct *tsk; 2044 struct task_struct *tsk;
2045
2045 /* 2046 /*
2046 * Validate dentry by checking the superblock operations 2047 * Validate dentry by checking the superblock operations,
2048 * and make sure it's a directory.
2047 */ 2049 */
2048 if (dentry->d_sb->s_op != &cgroup_ops) 2050 if (dentry->d_sb->s_op != &cgroup_ops ||
2051 !S_ISDIR(dentry->d_inode->i_mode))
2049 goto err; 2052 goto err;
2050 2053
2051 ret = 0; 2054 ret = 0;
@@ -2475,10 +2478,7 @@ static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry)
2475 mutex_unlock(&cgroup_mutex); 2478 mutex_unlock(&cgroup_mutex);
2476 return -EBUSY; 2479 return -EBUSY;
2477 } 2480 }
2478 2481 mutex_unlock(&cgroup_mutex);
2479 parent = cgrp->parent;
2480 root = cgrp->root;
2481 sb = root->sb;
2482 2482
2483 /* 2483 /*
2484 * Call pre_destroy handlers of subsys. Notify subsystems 2484 * Call pre_destroy handlers of subsys. Notify subsystems
@@ -2486,7 +2486,14 @@ static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry)
2486 */ 2486 */
2487 cgroup_call_pre_destroy(cgrp); 2487 cgroup_call_pre_destroy(cgrp);
2488 2488
2489 if (cgroup_has_css_refs(cgrp)) { 2489 mutex_lock(&cgroup_mutex);
2490 parent = cgrp->parent;
2491 root = cgrp->root;
2492 sb = root->sb;
2493
2494 if (atomic_read(&cgrp->count)
2495 || !list_empty(&cgrp->children)
2496 || cgroup_has_css_refs(cgrp)) {
2490 mutex_unlock(&cgroup_mutex); 2497 mutex_unlock(&cgroup_mutex);
2491 return -EBUSY; 2498 return -EBUSY;
2492 } 2499 }