projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a2ddaf9
)
bcachefs: Fix early error path in bch2_fs_btree_key_cache_exit()
author
Kent Overstreet
<kent.overstreet@linux.dev>
Fri, 3 May 2024 15:39:53 +0000
(11:39 -0400)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Mon, 6 May 2024 14:58:17 +0000
(10:58 -0400)
Reported-by: syzbot+a35cdb62ec34d44fb062@syzkaller.appspotmail.com
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_key_cache.c
patch
|
blob
|
history
diff --git
a/fs/bcachefs/btree_key_cache.c
b/fs/bcachefs/btree_key_cache.c
index
e8c1c53
..
7dafa1a
100644
(file)
--- a/
fs/bcachefs/btree_key_cache.c
+++ b/
fs/bcachefs/btree_key_cache.c
@@
-956,13
+956,15
@@
void bch2_fs_btree_key_cache_exit(struct btree_key_cache *bc)
}
#ifdef __KERNEL__
- for_each_possible_cpu(cpu) {
- struct btree_key_cache_freelist *f =
- per_cpu_ptr(bc->pcpu_freed, cpu);
-
- for (i = 0; i < f->nr; i++) {
- ck = f->objs[i];
- list_add(&ck->list, &items);
+ if (bc->pcpu_freed) {
+ for_each_possible_cpu(cpu) {
+ struct btree_key_cache_freelist *f =
+ per_cpu_ptr(bc->pcpu_freed, cpu);
+
+ for (i = 0; i < f->nr; i++) {
+ ck = f->objs[i];
+ list_add(&ck->list, &items);
+ }
}
}
#endif