Commit 554d219e authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Add missing bch2_btree_node_iter_fix() call

Any time we're modifying what's in the btree, iterators potentially have
to be updated - this one was exposed by the reflink code.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 4d13e818
......@@ -183,9 +183,8 @@ bool bch2_btree_bset_insert_key(struct btree_iter *iter,
clobber_u64s = 0;
overwrite:
bch2_bset_insert(b, node_iter, k, insert, clobber_u64s);
if (k->u64s != clobber_u64s || bkey_whiteout(&insert->k))
bch2_btree_node_iter_fix(iter, b, node_iter, k,
clobber_u64s, k->u64s);
bch2_btree_node_iter_fix(iter, b, node_iter, k,
clobber_u64s, k->u64s);
bch2_btree_iter_verify(iter, b);
return true;
}
......
......@@ -1270,6 +1270,8 @@ static void __bch2_insert_fixup_extent(struct bch_fs *c,
btree_account_key_drop(l->b, _k);
_k->type = KEY_TYPE_discard;
reserve_whiteout(l->b, _k);
bch2_btree_node_iter_fix(iter, l->b, &l->iter,
_k, _k->u64s, _k->u64s);
}
break;
}
......
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