projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cf0dd69
)
bcachefs: Fix a null ptr deref
author
Kent Overstreet
<kent.overstreet@gmail.com>
Sun, 10 Apr 2022 18:36:10 +0000
(14:36 -0400)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:31 +0000
(17:09 -0400)
We start doing allocations before the GC thread is created, which means
we need to check for that to avoid a null ptr deref.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/btree_gc.h
patch
|
blob
|
history
diff --git
a/fs/bcachefs/btree_gc.h
b/fs/bcachefs/btree_gc.h
index 8de54005e4eaf8f299c5318b8dbd3ef7c6ba0df2..95d803b5743de5bb9e8bc5d58a868e9b795c27cf 100644
(file)
--- a/
fs/bcachefs/btree_gc.h
+++ b/
fs/bcachefs/btree_gc.h
@@
-105,7
+105,8
@@
static inline bool gc_visited(struct bch_fs *c, struct gc_pos pos)
static inline void bch2_do_gc_gens(struct bch_fs *c)
{
atomic_inc(&c->kick_gc);
- wake_up_process(c->gc_thread);
+ if (c->gc_thread)
+ wake_up_process(c->gc_thread);
}
#endif /* _BCACHEFS_BTREE_GC_H */