summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-05-14 13:25:25 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2019-06-10 14:08:05 -0400
commite8cf623efed27836f9681049a38360a2772ec67b (patch)
treec5c65ca07315ecb6aeccb5f4300d25760a368f84
parentcba5c5cc14c7e7bdd2c2f8d4af9ca817b1790c05 (diff)
bcachefs: Fix a bug with multiple iterators being traversed
If upgrade fails on one iterator, but it was copied from another iterator and will be freed before transaction restart, then the original iterator will get traversed first, so we need to make required btree nodes on the original iterator will be traversed too. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/btree_iter.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c
index 82e8e7ebcc2b..4931ca740b9f 100644
--- a/fs/bcachefs/btree_iter.c
+++ b/fs/bcachefs/btree_iter.c
@@ -316,7 +316,6 @@ bool __bch2_btree_iter_upgrade(struct btree_iter *iter,
trans_for_each_iter(iter->trans, linked)
if (linked != iter &&
linked->btree_id == iter->btree_id &&
- btree_iter_cmp(linked, iter) <= 0 &&
linked->locks_want < new_locks_want) {
linked->locks_want = new_locks_want;
btree_iter_get_locks(linked, true);