bcachefs: All held locks must be in a btree path
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 16 Sep 2022 18:42:38 +0000 (14:42 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:40 +0000 (17:09 -0400)
commite4215d0fec777e6516306f5f1b69a45a4205dce0
treebd67300e7d9e04babe4d1bcfa5da83b703910cc3
parent367d72dd5fd5b9e0b87633cbcb11b58b91d6bcc5
bcachefs: All held locks must be in a btree path

With the new deadlock cycle detector, it's critical that all held locks
be marked in a btree_path, because that's what the cycle detector
traverses - any locks that aren't correctly marked will cause deadlocks.

This changes the btree_path to allocate some btree_paths for the new
nodes, since until the final update is done we otherwise don't have a
path referencing them.

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