cgroup: fix error path of cgroup_addrm_files()
authorTejun Heo <tj@kernel.org>
Fri, 28 Jun 2013 23:24:10 +0000 (16:24 -0700)
committerTejun Heo <tj@kernel.org>
Fri, 12 Jul 2013 19:34:01 +0000 (12:34 -0700)
commitb1f28d3109349899e87377e89f9d8ab5bc95ec57
tree817a277b89882a82e5e52fd3911d81b819709c41
parent8f89140ae41ccd9c63344e6823faa862aa7435e3
cgroup: fix error path of cgroup_addrm_files()

cgroup_addrm_files() mishandled error return value from
cgroup_add_file() and returns error iff the last file fails to create.
As we're in the process of cleaning up file add/rm error handling and
will reliably propagate file creation failures, there's no point in
keeping adding files after a failure.

Replace the broken error collection logic with immediate error return.
While at it, add lockdep assertions and function comment.

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