bcachefs: Fix BTREE_TRIGGER_WANTS_OLD_AND_NEW
authorKent Overstreet <kent.overstreet@gmail.com>
Sun, 13 Mar 2022 05:30:16 +0000 (00:30 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:28 +0000 (17:09 -0400)
commit5d93a842c1eb292e2cde9f5025628269d7d386e0
tree29dc0801ba4716d40288a0ec26f834b45a050f55
parent880e2275f9f1461c87cd113a8da291861cc01400
bcachefs: Fix BTREE_TRIGGER_WANTS_OLD_AND_NEW

BTREE_TRIGGER_WANTS_OLD_AND_NEW didn't work correctly when the old and
new key were both alloc keys, but different versions - it required old
and new key type to be identical, and this bug is a problem for the new
allocator rewrite.

This patch fixes it by checking if the old and new key have the same
trigger functions - the different versions of alloc (and inode) keys
have the same trigger functions.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/btree_update_leaf.c