mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
bcachefs: Assert that iterators aren't being double freed
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
50dc0f692a
commit
e9895f0ab9
@ -1956,6 +1956,7 @@ int bch2_trans_iter_put(struct btree_trans *trans,
|
||||
return 0;
|
||||
|
||||
BUG_ON(trans->iters + iter->idx != iter);
|
||||
BUG_ON(!btree_iter_live(trans, iter));
|
||||
|
||||
ret = btree_iter_err(iter);
|
||||
|
||||
|
@ -1500,6 +1500,10 @@ static struct btree_iter *trans_get_update(struct btree_trans *trans,
|
||||
bkey_cmp(pos, i->k->k.p) < 0
|
||||
: !bkey_cmp(pos, i->iter->pos))) {
|
||||
*k = bkey_i_to_s_c(i->k);
|
||||
|
||||
/* ugly hack.. */
|
||||
BUG_ON(btree_iter_live(trans, i->iter));
|
||||
trans->iters_live |= 1ULL << i->iter->idx;
|
||||
return i->iter;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user