Commit 107fe5af authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix a pcpu var splat

this_cpu_ptr() emits a warning when used without preemption disabled -
harmless in this case, as we have other locking where
bch2_acc_percpu_u64s() is used.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 4b09ef12
...@@ -893,9 +893,14 @@ void eytzinger0_find_test(void) ...@@ -893,9 +893,14 @@ void eytzinger0_find_test(void)
*/ */
u64 *bch2_acc_percpu_u64s(u64 __percpu *p, unsigned nr) u64 *bch2_acc_percpu_u64s(u64 __percpu *p, unsigned nr)
{ {
u64 *ret = this_cpu_ptr(p); u64 *ret;
int cpu; int cpu;
/* access to pcpu vars has to be blocked by other locking */
preempt_disable();
ret = this_cpu_ptr(p);
preempt_enable();
for_each_possible_cpu(cpu) { for_each_possible_cpu(cpu) {
u64 *i = per_cpu_ptr(p, cpu); u64 *i = per_cpu_ptr(p, cpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment