diff options
Diffstat (limited to 'fs/bcachefs/util.c')
| -rw-r--r-- | fs/bcachefs/util.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c index f287bca8498d..8211c9a1b6cb 100644 --- a/fs/bcachefs/util.c +++ b/fs/bcachefs/util.c @@ -893,9 +893,14 @@ void eytzinger0_find_test(void) */ u64 *bch2_acc_percpu_u64s(u64 __percpu *p, unsigned nr) { - u64 *ret = this_cpu_ptr(p); + u64 *ret; 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) { u64 *i = per_cpu_ptr(p, cpu); |
