diff options
author | Tejun Heo <tj@kernel.org> | 2015-09-18 17:54:23 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2015-09-18 17:54:23 -0400 |
commit | 7dbdb199d3bf88f043ea17e97113eb28d5b100bc (patch) | |
tree | 648451cd5f719dafe1c01a18cf2a7903d6166f93 /kernel/cpuset.c | |
parent | 4a07c222d3afb00e1113834fee38d23a8e5d71dc (diff) | |
download | blackbird-op-linux-7dbdb199d3bf88f043ea17e97113eb28d5b100bc.tar.gz blackbird-op-linux-7dbdb199d3bf88f043ea17e97113eb28d5b100bc.zip |
cgroup: replace cftype->mode with CFTYPE_WORLD_WRITABLE
cftype->mode allows controllers to give arbitrary permissions to
interface knobs. Except for "cgroup.event_control", the existing uses
are spurious.
* Some explicitly specify S_IRUGO | S_IWUSR even though that's the
default.
* "cpuset.memory_pressure" specifies S_IRUGO while also setting a
write callback which returns -EACCES. All it needs to do is simply
not setting a write callback.
"cgroup.event_control" uses cftype->mode to make the file
world-writable. It's a misdesigned interface and we don't want
controllers to be tweaking interface file permissions in general.
This patch removes cftype->mode and all its spurious uses and
implements CFTYPE_WORLD_WRITABLE for "cgroup.event_control" which is
marked as compatibility-only.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r-- | kernel/cpuset.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 20eedd8098c0..312961ef3ccc 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -1597,9 +1597,6 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft, case FILE_MEMORY_PRESSURE_ENABLED: cpuset_memory_pressure_enabled = !!val; break; - case FILE_MEMORY_PRESSURE: - retval = -EACCES; - break; case FILE_SPREAD_PAGE: retval = update_flag(CS_SPREAD_PAGE, cs, val); break; @@ -1866,9 +1863,6 @@ static struct cftype files[] = { { .name = "memory_pressure", .read_u64 = cpuset_read_u64, - .write_u64 = cpuset_write_u64, - .private = FILE_MEMORY_PRESSURE, - .mode = S_IRUGO, }, { |