Li Zefan
aa32362f01
cgroup: check cgroup liveliness before unbreaking kernfs
...
When cgroup_kn_lock_live() is called through some kernfs operation and
another thread is calling cgroup_rmdir(), we'll trigger the warning in
cgroup_get().
------------[ cut here ]------------
WARNING: CPU: 1 PID: 1228 at kernel/cgroup.c:1034 cgroup_get+0x89/0xa0()
...
Call Trace:
[<c16ee73d>] dump_stack+0x41/0x52
[<c10468ef>] warn_slowpath_common+0x7f/0xa0
[<c104692d>] warn_slowpath_null+0x1d/0x20
[<c10bb999>] cgroup_get+0x89/0xa0
[<c10bbe58>] cgroup_kn_lock_live+0x28/0x70
[<c10be3c1>] __cgroup_procs_write.isra.26+0x51/0x230
[<c10be5b2>] cgroup_tasks_write+0x12/0x20
[<c10bb7b0>] cgroup_file_write+0x40/0x130
[<c11aee71>] kernfs_fop_write+0xd1/0x160
[<c1148e58>] vfs_write+0x98/0x1e0
[<c114934d>] SyS_write+0x4d/0xa0
[<c16f656b>] sysenter_do_call+0x12/0x12
---[ end trace 6f2e0c38c2108a74 ]---
Fix this by calling css_tryget() instead of cgroup_get().
v2:
- move cgroup_tryget() right below cgroup_get() definition. (Tejun)
Cc: <stable@vger.kernel.org> # 3.15+
Reported-by: Toralf Förster <toralf.foerster@gmx.de>
Signed-off-by: Zefan Li <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
2014-09-05 01:36:19 +09:00
..
2014-08-02 15:03:58 -07:00
2014-06-12 16:18:45 +02:00
2014-08-08 15:57:17 -07:00
2014-08-08 15:57:24 -07:00
2014-08-05 17:38:45 -07:00
2014-07-17 12:32:47 +02:00
2014-08-11 23:19:48 +02:00
2014-08-13 15:13:44 +10:00
2014-08-04 15:55:08 -07:00
2014-08-11 23:19:48 +02:00
2014-08-14 11:04:11 -06:00
2014-08-09 17:29:36 -07:00
2013-12-10 18:21:34 +00:00
2014-08-08 15:57:27 -07:00
2014-02-18 11:17:17 +01:00
2014-02-18 11:17:17 +01:00
2014-07-24 21:53:47 +10:00
2014-03-20 10:10:53 -04:00
2014-08-06 18:01:12 -07:00
2014-06-10 08:44:40 -07:00
2014-06-04 16:54:14 -07:00
2014-08-08 15:57:18 -07:00
2014-07-24 21:53:47 +10:00
2014-07-15 11:05:09 -04:00
2014-09-05 01:36:19 +09:00
2014-06-04 16:54:19 -07:00
2014-06-14 09:07:44 +02:00
2014-07-05 11:17:45 +02:00
2014-08-04 10:11:28 -07:00
2014-07-23 10:18:06 -07:00
2013-11-09 00:16:23 -05:00
2014-06-04 16:54:15 -07:00
2014-08-08 15:57:22 -07:00
2014-02-13 18:13:22 -08:00
2014-08-11 13:29:12 -07:00
2013-12-19 13:50:32 -05:00
2014-02-02 14:09:12 -08:00
2014-06-21 22:26:24 +02:00
2014-04-03 16:21:05 -07:00
2014-06-04 16:54:15 -07:00
2014-07-05 11:17:26 +02:00
2013-10-19 19:45:35 -04:00
2014-08-08 15:57:18 -07:00
2013-11-15 09:32:22 +09:00
2014-07-16 14:57:13 +02:00
2014-08-08 15:57:33 -07:00
2014-06-06 16:08:12 -07:00
2014-07-18 06:23:40 +02:00
2014-04-25 12:00:49 -07:00
2014-07-28 14:07:52 -04:00
2014-06-04 16:54:15 -07:00
2014-08-08 15:57:32 -07:00
2013-10-25 17:15:18 -04:00
2014-08-16 04:47:00 +09:30
2014-04-24 10:26:39 +02:00
2014-07-29 18:08:50 -07:00
2013-12-05 21:28:42 +08:00
2014-08-08 15:57:24 -07:00
2014-07-17 22:07:37 +02:00
2014-04-02 16:20:21 -07:00
2014-06-06 16:08:13 -07:00
2014-07-16 15:10:39 +02:00
2014-06-04 16:54:15 -07:00
2014-04-12 14:49:50 -07:00
2014-06-04 16:54:15 -07:00
2014-08-08 15:57:32 -07:00
2014-08-11 13:29:12 -07:00
2014-08-09 09:58:12 -07:00
2014-08-06 18:01:22 -07:00
2014-05-22 11:36:10 +02:00
2014-06-04 16:54:15 -07:00
2014-08-08 15:57:32 -07:00
2014-07-18 12:13:38 -07:00
2014-07-01 12:16:24 -07:00
2014-08-06 18:01:19 -07:00
2013-12-10 18:25:28 +00:00
2014-07-17 09:35:17 -04:00
2013-11-19 16:39:05 -05:00
2014-08-08 15:57:18 -07:00
2014-07-07 10:12:56 -07:00
2014-06-21 00:15:26 -04:00
2014-07-23 10:18:05 -07:00
2014-02-24 14:47:15 -08:00
2014-08-08 15:57:22 -07:00
2014-06-04 16:54:16 -07:00
2014-06-06 16:08:16 -07:00
2014-07-29 18:08:50 -07:00
2014-08-08 15:57:24 -07:00
2014-05-20 10:59:32 -04:00
2014-08-04 10:09:27 -07:00