From a8eefbd324cd40fab57ab8eef88347d4f745db93 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sat, 1 Oct 2022 22:15:30 -0400 Subject: 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 --- fs/bcachefs/errcode.h | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/bcachefs/errcode.h') diff --git a/fs/bcachefs/errcode.h b/fs/bcachefs/errcode.h index bf7ae99d9cce..fb1e1cd0f864 100644 --- a/fs/bcachefs/errcode.h +++ b/fs/bcachefs/errcode.h @@ -42,6 +42,7 @@ x(BCH_ERR_transaction_restart, transaction_restart_key_cache_raced) \ x(BCH_ERR_transaction_restart, transaction_restart_key_cache_realloced)\ x(BCH_ERR_transaction_restart, transaction_restart_journal_preres_get) \ + x(BCH_ERR_transaction_restart, transaction_restart_split_race) \ x(BCH_ERR_transaction_restart, transaction_restart_nested) \ x(0, no_btree_node) \ x(BCH_ERR_no_btree_node, no_btree_node_relock) \ -- cgit v1.2.3