bcachefs: Add error path to btree_split()
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 2 Oct 2022 02:15:30 +0000 (22:15 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:43 +0000 (17:09 -0400)
commita8eefbd324cd40fab57ab8eef88347d4f745db93
treee1a5624e05587daf4d15b3d04cdaedcfb8b6a8a7
parent8cbb0002509a605972781c0e747ae68112f94f54
bcachefs: Add error path to btree_split()

The next patch in the series is (finally!) going to change btree splits
(and interior updates in general) to not take intent locks all the way
up to the root - instead only locking the nodes they'll need to modify.

However, this will be introducing a race since if we're not holding a
write lock on a btree node it can be written out by another thread, and
then we might not have enough space for a new bset entry.

We can handle this by retrying - we just need to introduce a new error
path.

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