Skip to content

Commit 7d6c63c

Browse files
shakeelbhtejun
authored andcommitted
cgroup: rstat: call cgroup_rstat_updated_list with cgroup_rstat_lock
The commit 093c881 ("cgroup: rstat: Cleanup flushing functions and locking") during cleanup accidentally changed the code to call cgroup_rstat_updated_list() without cgroup_rstat_lock which is required. Fix it. Fixes: 093c881 ("cgroup: rstat: Cleanup flushing functions and locking") Reported-by: Jakub Kicinski <kuba@kernel.org> Reported-by: Breno Leitao <leitao@debian.org> Reported-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com> Closes: https://lore.kernel.org/all/6564c3d6-9372-4352-9847-1eb3aea07ca4@linux.ibm.com/ Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent e8a457b commit 7d6c63c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/cgroup/rstat.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,11 @@ __bpf_kfunc void cgroup_rstat_flush(struct cgroup *cgrp)
318318

319319
might_sleep();
320320
for_each_possible_cpu(cpu) {
321-
struct cgroup *pos = cgroup_rstat_updated_list(cgrp, cpu);
321+
struct cgroup *pos;
322322

323323
/* Reacquire for each CPU to avoid disabling IRQs too long */
324324
__cgroup_rstat_lock(cgrp, cpu);
325+
pos = cgroup_rstat_updated_list(cgrp, cpu);
325326
for (; pos; pos = pos->rstat_flush_next) {
326327
struct cgroup_subsys_state *css;
327328

0 commit comments

Comments
 (0)