summary refs log tree commit diff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-10-14 14:58:32 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-10-14 14:58:32 -0700
commit2f6c6d0891b472bbda70dfcc51fbb3147b6f54a0 (patch)
treeb85824f24a5af8848f246bf1369982388ff12a06
parent09cad07547445bf3a41683e4d3abcd154c123ef5 (diff)
parent65026da59cda16baf6c3e98b74ec439f366e468f (diff)
downloadlinux-2f6c6d0891b472bbda70dfcc51fbb3147b6f54a0.tar.gz
Merge branch 'for-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup updates from Tejun Heo:
 "Two minor changes.

  One makes cgroup interface files ignore zero-sized writes rather than
  triggering -EINVAL on them. The other change is a cleanup which
  doesn't cause any behavior changes"

* 'for-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
  cgroup: Zero sized write should be no-op
  cgroup: remove redundant kernfs_activate in cgroup_setup_root()
-rw-r--r--kernel/cgroup/cgroup.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index dd247747ec14..e41c21819ba0 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -2006,7 +2006,6 @@ int cgroup_setup_root(struct cgroup_root *root, u16 ss_mask)
 	BUG_ON(!list_empty(&root_cgrp->self.children));
 	BUG_ON(atomic_read(&root->nr_cgrps) != 1);
 
-	kernfs_activate(root_cgrp->kn);
 	ret = 0;
 	goto out;
 
@@ -3682,6 +3681,9 @@ static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf,
 	struct cgroup_subsys_state *css;
 	int ret;
 
+	if (!nbytes)
+		return 0;
+
 	/*
 	 * If namespaces are delegation boundaries, disallow writes to
 	 * files in an non-init namespace root from inside the namespace