Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 339343
b: refs/heads/master
c: b8a2df6
h: refs/heads/master
i:
  339341: 7bcfd1d
  339339: 05d9432
  339335: 09f0aa1
  339327: 03f752c
v: v3
  • Loading branch information
Tejun Heo committed Nov 19, 2012
1 parent 675d230 commit 1e25a39
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 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: d19e19de48aa0b90c56cd93c8a46ebac46273429
refs/heads/master: b8a2df6a5b576d04f78f54abf254c283527d8bbc
12 changes: 9 additions & 3 deletions trunk/kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -2657,9 +2657,15 @@ static int cgroup_create_file(struct dentry *dentry, umode_t mode,
inc_nlink(inode);
inc_nlink(dentry->d_parent->d_inode);

/* start with the directory inode held, so that we can
* populate it without racing with another mkdir */
mutex_lock_nested(&inode->i_mutex, I_MUTEX_CHILD);
/*
* Control reaches here with cgroup_mutex held.
* @inode->i_mutex should nest outside cgroup_mutex but we
* want to populate it immediately without releasing
* cgroup_mutex. As @inode isn't visible to anyone else
* yet, trylock will always succeed without affecting
* lockdep checks.
*/
WARN_ON_ONCE(!mutex_trylock(&inode->i_mutex));
} else if (S_ISREG(mode)) {
inode->i_size = 0;
inode->i_fop = &cgroup_file_operations;
Expand Down

0 comments on commit 1e25a39

Please sign in to comment.