[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190403084650.4414-7-juri.lelli@redhat.com>
Date: Wed, 3 Apr 2019 10:46:49 +0200
From: Juri Lelli <juri.lelli@...hat.com>
To: peterz@...radead.org, mingo@...hat.com, rostedt@...dmis.org,
tj@...nel.org
Cc: linux-kernel@...r.kernel.org, luca.abeni@...tannapisa.it,
claudio@...dence.eu.com, tommaso.cucinotta@...tannapisa.it,
bristot@...hat.com, mathieu.poirier@...aro.org, lizefan@...wei.com,
cgroups@...r.kernel.org, Juri Lelli <juri.lelli@...hat.com>
Subject: [PATCH v7 6/7] cgroup/cpuset: Use cpuset_mutex to protect seq_show operations
cpuset_common_seq_show operations atomicity is currently guarded by
callback_lock. Since these operations are initiated by userspace holding
a raw_spin_lock is not wise.
Convert the function to use cpuset_mutex to fix the problem.
Signed-off-by: Juri Lelli <juri.lelli@...hat.com>
---
kernel/cgroup/cpuset.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index cb5ff6ca5d2c..91ef48bbc08d 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -2444,7 +2444,7 @@ static int cpuset_common_seq_show(struct seq_file *sf, void *v)
cpuset_filetype_t type = seq_cft(sf)->private;
int ret = 0;
- raw_spin_lock_irq(&callback_lock);
+ mutex_lock(&cpuset_mutex);
switch (type) {
case FILE_CPULIST:
@@ -2466,7 +2466,7 @@ static int cpuset_common_seq_show(struct seq_file *sf, void *v)
ret = -EINVAL;
}
- raw_spin_unlock_irq(&callback_lock);
+ mutex_unlock(&cpuset_mutex);
return ret;
}
--
2.17.2
Powered by blists - more mailing lists