Commit 17047fbc authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix incorrectly freeing btree_path in alloc path

Clearing path->preserve means the path will be dropping in
bch2_trans_begin() - but on transaction restart, we're likely to need
that path again.

This fixes a livelock in the allocation path.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 86b74451
...@@ -335,6 +335,7 @@ void bch2_trans_copy_iter(struct btree_iter *, struct btree_iter *); ...@@ -335,6 +335,7 @@ void bch2_trans_copy_iter(struct btree_iter *, struct btree_iter *);
static inline void set_btree_iter_dontneed(struct btree_iter *iter) static inline void set_btree_iter_dontneed(struct btree_iter *iter)
{ {
if (!iter->trans->restarted)
iter->path->preserve = false; iter->path->preserve = false;
} }
......
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