Linux cgroups development
 help / color / mirror / Atom feed
* [PATCH cgroup/for-4.13-fixes] cgroup: fix error return value from cgroup_subtree_control()
@ 2017-07-23 12:14 Tejun Heo
  2017-07-23 12:15 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2017-07-23 12:14 UTC (permalink / raw)
  To: Li Zefan, Johannes Weiner; +Cc: cgroups, kernel-team, linux-kernel

While refactoring, f7b2814bb9b6 ("cgroup: factor out
cgroup_{apply|finalize}_control() from
cgroup_subtree_control_write()") broke error return value from the
function.  The return value from the last operation is always
overridden to zero.  Fix it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@vger.kernel.org # v4.6+
---
 kernel/cgroup/cgroup.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -3119,11 +3119,11 @@ static ssize_t cgroup_subtree_control_wr
 	cgrp->subtree_control &= ~disable;
 
 	ret = cgroup_apply_control(cgrp);
-
 	cgroup_finalize_control(cgrp, ret);
+	if (ret)
+		goto out_unlock;
 
 	kernfs_activate(cgrp->kn);
-	ret = 0;
 out_unlock:
 	cgroup_kn_unlock(of->kn);
 	return ret ?: nbytes;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH cgroup/for-4.13-fixes] cgroup: fix error return value from cgroup_subtree_control()
  2017-07-23 12:14 [PATCH cgroup/for-4.13-fixes] cgroup: fix error return value from cgroup_subtree_control() Tejun Heo
@ 2017-07-23 12:15 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2017-07-23 12:15 UTC (permalink / raw)
  To: Li Zefan, Johannes Weiner; +Cc: cgroups, kernel-team, linux-kernel

On Sun, Jul 23, 2017 at 08:14:15AM -0400, Tejun Heo wrote:
> While refactoring, f7b2814bb9b6 ("cgroup: factor out
> cgroup_{apply|finalize}_control() from
> cgroup_subtree_control_write()") broke error return value from the
> function.  The return value from the last operation is always
> overridden to zero.  Fix it.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: stable@vger.kernel.org # v4.6+

Applying to cgroup/for-4.13-fixes.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-23 12:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-23 12:14 [PATCH cgroup/for-4.13-fixes] cgroup: fix error return value from cgroup_subtree_control() Tejun Heo
2017-07-23 12:15 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox