diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-06-28 00:01:19 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:05 -0400 |
commit | 65db60490a36cbfc0500cb86bf539614c89501d3 (patch) | |
tree | 849509ba1aece6ce5b856176dc9dd572ddec0ef0 /fs/bcachefs/btree_update_interior.c | |
parent | 0b9fbce235c3ae545b6f31b8f2de2de030689595 (diff) | |
download | linux-65db60490a36cbfc0500cb86bf539614c89501d3.tar.gz linux-65db60490a36cbfc0500cb86bf539614c89501d3.tar.bz2 linux-65db60490a36cbfc0500cb86bf539614c89501d3.zip |
bcachefs: Fix a null ptr deref in bch2_fs_alloc() error path
This fixes a null ptr deref in bch2_free_pending_node_rewrites() when
the list head wasn't initialized.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_update_interior.c')
-rw-r--r-- | fs/bcachefs/btree_update_interior.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_update_interior.c b/fs/bcachefs/btree_update_interior.c index 914cb80fc6d9..5d3a09039fab 100644 --- a/fs/bcachefs/btree_update_interior.c +++ b/fs/bcachefs/btree_update_interior.c @@ -2452,7 +2452,7 @@ void bch2_fs_btree_interior_update_exit(struct bch_fs *c) mempool_exit(&c->btree_interior_update_pool); } -int bch2_fs_btree_interior_update_init(struct bch_fs *c) +void bch2_fs_btree_interior_update_init_early(struct bch_fs *c) { mutex_init(&c->btree_reserve_cache_lock); INIT_LIST_HEAD(&c->btree_interior_update_list); @@ -2462,7 +2462,10 @@ int bch2_fs_btree_interior_update_init(struct bch_fs *c) INIT_LIST_HEAD(&c->pending_node_rewrites); mutex_init(&c->pending_node_rewrites_lock); +} +int bch2_fs_btree_interior_update_init(struct bch_fs *c) +{ c->btree_interior_update_worker = alloc_workqueue("btree_update", WQ_UNBOUND|WQ_MEM_RECLAIM, 1); if (!c->btree_interior_update_worker) |