Commit 70f0b0fd authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix verify_update_old_key()

This fixes a very-rare race in our assertion, with needs_whiteout being
modified in the btree key.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 3ea4219d
......@@ -56,9 +56,10 @@ static void verify_update_old_key(struct btree_trans *trans, struct btree_insert
k = bkey_i_to_s_c(j_k);
}
i->old_k.needs_whiteout = k.k->needs_whiteout;
u = *k.k;
u.needs_whiteout = i->old_k.needs_whiteout;
BUG_ON(memcmp(&i->old_k, k.k, sizeof(struct bkey)));
BUG_ON(memcmp(&i->old_k, &u, sizeof(struct bkey)));
BUG_ON(i->old_v != k.v);
#endif
}
......
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