bcachefs: Revalidate pointer to old bkey val before calling mem triggers
authorKent Overstreet <kent.overstreet@gmail.com>
Sat, 12 Mar 2022 21:14:55 +0000 (16:14 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:27 +0000 (17:09 -0400)
commitd13f9ee61dac0b5d663844c5778309ec8af1561f
tree32b5b88bf4f2bdddaef78b08d0de4a5a76eb16da
parent8570d775ca90192f8663ddd828a09d0c6698c71c
bcachefs: Revalidate pointer to old bkey val before calling mem triggers

We recently started stashing a copy of the key being overwritten in
btree_insert_entry: this is helpful for avoiding multiple calls to
bch2_btree_path_peek_slot() and bch2_journal_keys_peek() in the
transaction commit path.

But it turns out this has a problem - when we run mem/atomic triggers,
we've done a couple things that can invalidate the pointer to the old
key's value. This makes the optimization of stashing a pointer to the
old value questionable, but for now this patch revalidates that pointer
before running mem triggers.

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