<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/cgroup.c, branch v3.6</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.6</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2012-07-25T00:47:44Z</updated>
<entry>
<title>Merge branch 'for-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup</title>
<updated>2012-07-25T00:47:44Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-07-25T00:47:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=614a6d4341b3760ca98a1c2c09141b71db5d1e90'/>
<id>urn:sha1:614a6d4341b3760ca98a1c2c09141b71db5d1e90</id>
<content type='text'>
Pull cgroup changes from Tejun Heo:
 "Nothing too interesting.  A minor bug fix and some cleanups."

* 'for-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
  cgroup: Update remount documentation
  cgroup: cgroup_rm_files() was calling simple_unlink() with the wrong inode
  cgroup: Remove populate() documentation
  cgroup: remove hierarchy_mutex
</content>
</entry>
<entry>
<title>VFS: Pass mount flags to sget()</title>
<updated>2012-07-14T12:38:34Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2012-06-25T11:55:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9249e17fe094d853d1ef7475dd559a2cc7e23d42'/>
<id>urn:sha1:9249e17fe094d853d1ef7475dd559a2cc7e23d42</id>
<content type='text'>
Pass mount flags to sget() so that it can use them in initialising a new
superblock before the set function is called.  They could also be passed to the
compare function.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>stop passing nameidata to -&gt;lookup()</title>
<updated>2012-07-14T12:34:32Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2012-06-10T21:13:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=00cd8dd3bf95f2cc8435b4cac01d9995635c6d0b'/>
<id>urn:sha1:00cd8dd3bf95f2cc8435b4cac01d9995635c6d0b</id>
<content type='text'>
Just the flags; only NFS cares even about that, but there are
legitimate uses for such argument.  And getting rid of that
completely would require splitting -&gt;lookup() into a couple
of methods (at least), so let's leave that alone for now...

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>cgroup: cgroup_rm_files() was calling simple_unlink() with the wrong inode</title>
<updated>2012-07-09T17:11:14Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-07-03T17:38:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ce27e317ba22b359bde02216afab934dac3af095'/>
<id>urn:sha1:ce27e317ba22b359bde02216afab934dac3af095</id>
<content type='text'>
While refactoring cgroup file removal path, 05ef1d7c4a "cgroup:
introduce struct cfent" incorrectly changed the @dir argument of
simple_unlink() to the inode of the file being deleted instead of that
of the containing directory.

The effect of this bug is minor - ctime and mtime of the parent
weren't properly updated on file deletion.

Fix it by using @cgrp-&gt;dentry-&gt;d_inode instead.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Al Viro &lt;viro@ZenIV.linux.org.uk&gt;
Acked-by: Li Zefan &lt;lizefan@huawei.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>cgroup: fix cgroup hierarchy umount race</title>
<updated>2012-07-07T23:08:18Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-07-07T23:08:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5db9a4d99b0157a513944e9a44d29c9cec2e91dc'/>
<id>urn:sha1:5db9a4d99b0157a513944e9a44d29c9cec2e91dc</id>
<content type='text'>
48ddbe1946 "cgroup: make css-&gt;refcnt clearing on cgroup removal
optional" allowed a css to linger after the associated cgroup is
removed.  As a css holds a reference on the cgroup's dentry, it means
that cgroup dentries may linger for a while.

Destroying a superblock which has dentries with positive refcnts is a
critical bug and triggers BUG() in vfs code.  As each cgroup dentry
holds an s_active reference, any lingering cgroup has both its dentry
and the superblock pinned and thus preventing premature release of
superblock.

Unfortunately, after 48ddbe1946, there's a small window while
releasing a cgroup which is directly under the root of the hierarchy.
When a cgroup directory is released, vfs layer first deletes the
corresponding dentry and then invokes dput() on the parent, which may
recurse further, so when a cgroup directly below root cgroup is
released, the cgroup is first destroyed - which releases the s_active
it was holding - and then the dentry for the root cgroup is dput().

This creates a window where the root dentry's refcnt isn't zero but
superblock's s_active is.  If umount happens before or during this
window, vfs will see the root dentry with non-zero refcnt and trigger
BUG().

Before 48ddbe1946, this problem didn't exist because the last dentry
reference was guaranteed to be put synchronously from rmdir(2)
invocation which holds s_active around the whole process.

Fix it by holding an extra superblock-&gt;s_active reference across
dput() from css release, which is the dput() path added by 48ddbe1946
and the only one which doesn't hold an extra s_active ref across the
final cgroup dput().

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
LKML-Reference: &lt;4FEEA5CB.8070809@huawei.com&gt;
Reported-by: shyju pv &lt;shyju.pv@huawei.com&gt;
Tested-by: shyju pv &lt;shyju.pv@huawei.com&gt;
Cc: Sasha Levin &lt;levinsasha928@gmail.com&gt;
Acked-by: Li Zefan &lt;lizefan@huawei.com&gt;
</content>
</entry>
<entry>
<title>Revert "cgroup: superblock can't be released with active dentries"</title>
<updated>2012-07-07T22:55:47Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-07-07T22:55:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7db5b3ca0ecdb2e8fad52a4770e4e320e61c77a6'/>
<id>urn:sha1:7db5b3ca0ecdb2e8fad52a4770e4e320e61c77a6</id>
<content type='text'>
This reverts commit fa980ca87d15bb8a1317853f257a505990f3ffde.  The
commit was an attempt to fix a race condition where a cgroup hierarchy
may be unmounted with positive dentry reference on root cgroup.  While
the commit made the race condition slightly more difficult to trigger,
the race was still there and could be reliably triggered using a
different test case.

Revert the incorrect fix.  The next commit will describe the race and
fix it correctly.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
LKML-Reference: &lt;4FEEA5CB.8070809@huawei.com&gt;
Reported-by: shyju pv &lt;shyju.pv@huawei.com&gt;
Cc: Sasha Levin &lt;levinsasha928@gmail.com&gt;
Acked-by: Li Zefan &lt;lizefan@huawei.com&gt;
</content>
</entry>
<entry>
<title>cgroups: Account for CSS_DEACT_BIAS in __css_put</title>
<updated>2012-06-18T22:38:02Z</updated>
<author>
<name>Salman Qazi</name>
<email>sqazi@google.com</email>
</author>
<published>2012-06-14T21:55:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8e3bbf42c6d73881956863cc3305456afe2bc4ea'/>
<id>urn:sha1:8e3bbf42c6d73881956863cc3305456afe2bc4ea</id>
<content type='text'>
When we fixed the race between atomic_dec and css_refcnt, we missed
the fact that css_refcnt internally subtracts CSS_DEACT_BIAS to get
the actual reference count.  This can potentially cause a refcount leak
if __css_put races with cgroup_clear_css_refs.

Signed-off-by: Salman Qazi &lt;sqazi@google.com&gt;
Acked-by: Li Zefan &lt;lizefan@huawei.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>cgroup: remove hierarchy_mutex</title>
<updated>2012-06-07T02:12:30Z</updated>
<author>
<name>Li Zefan</name>
<email>lizefan@huawei.com</email>
</author>
<published>2012-06-07T02:12:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6be96a5c905178637ec06a5d456a76b2b304fca3'/>
<id>urn:sha1:6be96a5c905178637ec06a5d456a76b2b304fca3</id>
<content type='text'>
It was introduced for memcg to iterate cgroup hierarchy without
holding cgroup_mutex, but soon after that it was replaced with
a lockless way in memcg.

No one used hierarchy_mutex since that, so remove it.

Signed-off-by: Li Zefan &lt;lizefan@huawei.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>cgroup: make sure that decisions in __css_put are atomic</title>
<updated>2012-06-07T01:51:35Z</updated>
<author>
<name>Salman Qazi</name>
<email>sqazi@google.com</email>
</author>
<published>2012-06-07T01:51:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=967db0ea65b0bf8507a7643ac8f296c4f2c0a834'/>
<id>urn:sha1:967db0ea65b0bf8507a7643ac8f296c4f2c0a834</id>
<content type='text'>
__css_put is using atomic_dec on the ref count, and then
looking at the ref count to make decisions.  This is prone
to races, as someone else may decrement ref count between
our decrement and our decision.  Instead, we should base our
decisions on the value that we decremented the ref count to.

(This results in an actual race on Google's kernel which I
haven't been able to reproduce on the upstream kernel.  Having
said that, it's still incorrect by inspection).

Signed-off-by: Salman Qazi &lt;sqazi@google.com&gt;
Acked-by: Li Zefan &lt;lizefan@huawei.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>Merge branch 'for-3.5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup</title>
<updated>2012-06-05T18:54:12Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-06-05T18:54:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=365f0e173f44aad979c464eb8250f6138a9911ef'/>
<id>urn:sha1:365f0e173f44aad979c464eb8250f6138a9911ef</id>
<content type='text'>
Pull cgroup fix from Tejun Heo:
 "This fixes the possible premature superblock release on umount bug
  mentioned during v3.5-rc1 pull request.

  Originally, cgroup dentry destruction path assumed that cgroup dentry
  didn't have any reference left after cgroup removal thus put super
  during dentry removal.  Now that there can be lingering dentry
  references, this led to super being put with live dentries.  This
  patch fixes the problem by putting super ref on dentry release instead
  of removal."

* 'for-3.5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
  cgroup: superblock can't be released with active dentries
</content>
</entry>
</feed>
