bcachefs: Fix bch2_btree_update_start()
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 17 Jun 2023 03:30:02 +0000 (23:30 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:10:04 +0000 (17:10 -0400)
The calculation for number of nodes to allocate in
bch2_btree_update_start() was incorrect - this fixes a BUG_ON() on the
small nodes test.

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

index d2811c4756b7d7be5f753d26ad08c2c16778a856..e95e48857bb8b7a77d59219691801c4ca401a46c 100644 (file)
@@ -1077,7 +1077,7 @@ bch2_btree_update_start(struct btree_trans *trans, struct btree_path *path,
                                        BKEY_BTREE_PTR_U64s_MAX * (1 + split)))
                        break;
 
-               split = true;
+               split = path->l[update_level].b->nr.live_u64s > BTREE_SPLIT_THRESHOLD(c);
        }
 
        if (flags & BTREE_INSERT_GC_LOCK_HELD)