diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-03-05 15:21:07 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:27 -0400 |
commit | e1f7fa06a8ed48feedd5f538fc4724734c6e1869 (patch) | |
tree | 83942c1b575817d56ee1a934bad7ebd44624d0e6 /fs | |
parent | b60c380bca5458be9e4c0ff77289f0979fbbb52f (diff) |
bcachefs: Don't keep around btree_paths unnecessarily
When bch2_trans_begin() is called and there hasn't been a transaction
restart, we presume that we're now doing something new - iterating over
different keys, and we now shouldn't keep aruond paths related to the
previous transaction, excepting the subvolumes btree.
This should fix some of our "transaction path overflow" bugs.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bcachefs/btree_iter.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c index b65cd3566872..109efa73cd4c 100644 --- a/fs/bcachefs/btree_iter.c +++ b/fs/bcachefs/btree_iter.c @@ -3013,6 +3013,14 @@ void bch2_trans_begin(struct btree_trans *trans) path->should_be_locked = false; /* + * If the transaction wasn't restarted, we're presuming to be + * doing something new: dont keep iterators excpt the ones that + * are in use - except for the subvolumes btree: + */ + if (!trans->restarted && path->btree_id != BTREE_ID_subvolumes) + path->preserve = false; + + /* * XXX: we probably shouldn't be doing this if the transaction * was restarted, but currently we still overflow transaction * iterators if we do that |