Commit 6e811bbb authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix a null ptr deref

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: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent cf0dd697
......@@ -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 */
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