]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bcachefs: Don't call bch2_btree_interior_update_will_free_node() until after update...
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 5 Dec 2024 01:43:01 +0000 (20:43 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 21 Dec 2024 06:36:22 +0000 (01:36 -0500)
commit23f88c1d165563c9432314f92a9e7b8b6e17c7a2
tree6346d441d1c8537c3e6389214aedf9d31d13fb17
parentc67fab0774cee93b6aac9adc3601bcf0a4ea6ab4
bcachefs: Don't call bch2_btree_interior_update_will_free_node() until after update succeeds

Originally, btree splits always succeeded once we got to the point of
recursing to the btree_insert_node() call.

But that changed when we switched to not taking intent locks all the way
up to the root, and that introduced a bug, because
bch2_btree_interior_update_will_free_node() cancels paending writes and
reparents a node that's going to be made visible on disk by another
btree update to the current btree update.

This was discovered in recent backpointers work, because
bch2_btree_interior_update_will_free_node() also clears the
will_make_reachable flag, causing backpointer target lookup to
spuriously thing it had found a dangling backpointer (when the
backpointer just hadn't been created yet by
btree_update_nodes_written()).

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