Tejun Heo e605b36575 cgroup: fix cgroup_subsys_state leak for seq_files
If a cgroup file implements either read_map() or read_seq_string(),
such file is served using seq_file by overriding file->f_op to
cgroup_seqfile_operations, which also overrides the release method to
single_release() from cgroup_file_release().

Because cgroup_file_open() didn't use to acquire any resources, this
used to be fine, but since f7d58818ba42 ("cgroup: pin
cgroup_subsys_state when opening a cgroupfs file"), cgroup_file_open()
pins the css (cgroup_subsys_state) which is put by
cgroup_file_release().  The patch forgot to update the release path
for seq_files and each open/release cycle leaks a css reference.

Fix it by updating cgroup_file_release() to also handle seq_files and
using it for seq_file release path too.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@vger.kernel.org # v3.12
2013-11-27 18:16:21 -05:00
..
2013-11-13 12:09:34 +09:00
2013-11-19 01:07:08 +01:00
2013-11-13 13:33:55 +01:00
2013-04-22 07:09:06 -07:00
2013-09-09 11:19:09 -07:00
2013-10-09 12:36:13 +02:00
2013-11-27 13:52:47 -05:00
2012-12-20 17:40:19 -08:00
2013-11-09 00:16:29 -05:00
2013-09-11 15:58:27 -07:00
2013-04-29 13:55:38 -07:00