Commit 7d6c63c3 authored by Shakeel Butt's avatar Shakeel Butt Committed by Tejun Heo
Browse files

cgroup: rstat: call cgroup_rstat_updated_list with cgroup_rstat_lock



The commit 093c8812 ("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: 093c8812 ("cgroup: rstat: Cleanup flushing functions and locking")
Reported-by: default avatarJakub Kicinski <kuba@kernel.org>
Reported-by: default avatarBreno Leitao <leitao@debian.org>
Reported-by: default avatarVenkat Rao Bagalkote <venkat88@linux.ibm.com>
Closes: https://lore.kernel.org/all/6564c3d6-9372-4352-9847-1eb3aea07ca4@linux.ibm.com/


Signed-off-by: default avatarShakeel Butt <shakeel.butt@linux.dev>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent e8a457b7
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -318,10 +318,11 @@ __bpf_kfunc void cgroup_rstat_flush(struct cgroup *cgrp)

	might_sleep();
	for_each_possible_cpu(cpu) {
		struct cgroup *pos = cgroup_rstat_updated_list(cgrp, cpu);
		struct cgroup *pos;

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