Commit 7138f220 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix a spurious debug mode assertion

When we switched to using bch2_btree_bset_insert_key() for extents it
turned out it started leaving invalid keys around - of type deleted but
nonzero size - but this is fine (if ugly) because they're never written
out.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent ca47fa23
......@@ -846,7 +846,14 @@ static inline struct bkey_s_c __btree_iter_unpack(struct btree_iter *iter,
ret = bkey_disassemble(l->b, k, u);
if (bch2_debug_check_bkeys)
/*
* XXX: bch2_btree_bset_insert_key() generates invalid keys when we
* overwrite extents - it sets k->type = KEY_TYPE_deleted on the key
* being overwritten but doesn't change k->size. But this is ok, because
* those keys are never written out, we just have to avoid a spurious
* assertion here:
*/
if (bch2_debug_check_bkeys && !bkey_deleted(ret.k))
bch2_bkey_debugcheck(iter->trans->c, l->b, ret);
return ret;
......
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