cgroup: fix cgroup_write_event_control()
authorTejun Heo <tj@kernel.org>
Thu, 15 Aug 2013 15:43:15 +0000 (11:43 -0400)
committerTejun Heo <tj@kernel.org>
Mon, 19 Aug 2013 13:56:34 +0000 (09:56 -0400)
commit6e6eab0efdf48fb2d8d7aee904d7740acb4661c6
tree7805e157bdbe18844f650fa0a691cd8d1a6e1baf
parent0bfb4aa67cef4982adc70590a31624d7b35a0bda
cgroup: fix cgroup_write_event_control()

81eeaf0411 ("cgroup: make cftype->[un]register_event() deal with
cgroup_subsys_state inst ead of cgroup") updated the cftype event
methods to take @css (cgroup_subsys_state) instead of @cgroup;
however, it incorrectly used @css passed to
cgroup_write_event_control(), which the dummy_css for the cgroup as
the file is a cgroup core file.  This leads to oops on event
registration.

Fix it by using the css matching the event target file.  Note that
cgroup_write_event_control() now disallows cgroup core files from
being event sources.  This is for simplicity and doesn't matter as
cgroup_event will be moved and made specific to memcg.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
kernel/cgroup.c