Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 130391
b: refs/heads/master
c: 1404f06
h: refs/heads/master
i:
  130389: e92f707
  130387: acfd161
  130383: 816abfa
v: v3
  • Loading branch information
Li Zefan authored and Linus Torvalds committed Jan 30, 2009
1 parent 34d0302 commit 32d32cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 945048ca36173315afa2f0c53bed21ba01a588c1
refs/heads/master: 1404f06565ee89e0ce04d4a5859c00b0e3a0dc8d
13 changes: 7 additions & 6 deletions trunk/kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -2993,20 +2993,21 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys,
mutex_unlock(&cgroup_mutex);
return 0;
}
task_lock(tsk);
cg = tsk->cgroups;
parent = task_cgroup(tsk, subsys->subsys_id);

/* Pin the hierarchy */
if (!atomic_inc_not_zero(&parent->root->sb->s_active)) {
if (!atomic_inc_not_zero(&root->sb->s_active)) {
/* We race with the final deactivate_super() */
mutex_unlock(&cgroup_mutex);
return 0;
}

/* Keep the cgroup alive */
task_lock(tsk);
parent = task_cgroup(tsk, subsys->subsys_id);
cg = tsk->cgroups;
get_css_set(cg);
task_unlock(tsk);

mutex_unlock(&cgroup_mutex);

/* Now do the VFS work to create a cgroup */
Expand Down Expand Up @@ -3045,7 +3046,7 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys,
mutex_unlock(&inode->i_mutex);
put_css_set(cg);

deactivate_super(parent->root->sb);
deactivate_super(root->sb);
/* The cgroup is still accessible in the VFS, but
* we're not going to try to rmdir() it at this
* point. */
Expand All @@ -3071,7 +3072,7 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys,
mutex_lock(&cgroup_mutex);
put_css_set(cg);
mutex_unlock(&cgroup_mutex);
deactivate_super(parent->root->sb);
deactivate_super(root->sb);
return ret;
}

Expand Down

0 comments on commit 32d32cd

Please sign in to comment.