bcachefs: Assert that we're not violating key cache coherency rules
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 26 Oct 2024 02:31:20 +0000 (22:31 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 21 Dec 2024 06:36:17 +0000 (01:36 -0500)
commit65b14fa3d83588d55441384ea1c0b3eacfac0a1b
tree7358b3af1babadf0b2f33b6976e031cfc37aea6b
parentb318882022a8ab67e9b1682bed52366072592fa7
bcachefs: Assert that we're not violating key cache coherency rules

We're not allowed to have a dirty key in the key cache if the key
doesn't exist at all in the btree - creation has to bypass the key
cache, so that iteration over the btree can check if the key is present
in the key cache.

Things break in subtle ways if cache coherency is broken, so this needs
an assert.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_key_cache.c