bcachefs: Call bch2_btree_update_add_new_node() before dropping write lock
authorKent Overstreet <kent.overstreet@linux.dev>
Wed, 12 Oct 2022 15:04:28 +0000 (11:04 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:43 +0000 (17:09 -0400)
commitde107dc8008fe559ac39e89cabc4d21d0129684e
tree40f60018c5a2ffaee56af459f35e07c4af776a21
parente8540e56812360d4253b6a30e46452ce7448b24b
bcachefs: Call bch2_btree_update_add_new_node() before dropping write lock

btree nodes can be written by other threads (shrinker, journal reclaim)
with only a read lock, but brand new nodes should only be written by the
thread doing the split/interior update. bch2_btree_update_add_new_node()
sets btree node flags to indicate that this is a new node and should not
be written out by other threads, thus we need to call it before dropping
our write lock.

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