diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-08-15 15:55:19 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-08-15 15:55:19 -0400 |
commit | cad56cdb66b6fe4b67c6dbe1fd79d053312f5ff7 (patch) | |
tree | 0bbdcb19690c5cf493f994b72e825964d100d13e | |
parent | 3215ae3df9f37e7151acd5fb5c7a815d3d77de99 (diff) |
fixup! bcachefs: Zero btree_paths on allocation
-rw-r--r-- | fs/bcachefs/btree_iter.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c index f5b17938b063..dee9d2722ace 100644 --- a/fs/bcachefs/btree_iter.c +++ b/fs/bcachefs/btree_iter.c @@ -2898,12 +2898,14 @@ static void bch2_trans_alloc_paths(struct btree_trans *trans, struct bch_fs *c) #ifdef __KERNEL__ p = this_cpu_xchg(c->btree_paths_bufs->path, NULL); #endif - if (!p) - p = mempool_alloc(&trans->c->btree_paths_pool, GFP_NOFS|__GFP_ZERO); - /* - * paths need to be zeroed, bch2_check_for_deadlock looks at paths in - * other threads - */ + if (!p) { + p = mempool_alloc(&trans->c->btree_paths_pool, GFP_NOFS); + /* + * paths need to be zeroed, bch2_check_for_deadlock looks at + * paths in other threads + */ + memset(p, 0, paths_bytes); + } trans->paths = p; p += paths_bytes; trans->updates = p; p += updates_bytes; |