diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-10-07 18:18:01 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-17 15:44:08 -0400 |
commit | 1c09037a5b7284ae0a437eb1a851e73d80c31d5b (patch) | |
tree | 070dd61a97b76dfeb6c86615c5e3524f9e5d6419 | |
parent | b83a6af08d5fdb0b5ac7b033165a1d083828c522 (diff) |
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: Kent Overstreet <kent.overstreet@gmail.com>
-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 463260c04585..9f21f68e84d3 100644 --- a/fs/bcachefs/util.c +++ b/fs/bcachefs/util.c @@ -887,9 +887,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); |