summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/btree_io.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-03-26 21:39:54 +0100
committerKent Overstreet <kent.overstreet@linux.dev>2024-04-01 02:36:11 +0200
commit812a9297936a959c98a2e9e44a9a622bbe30b162 (patch)
treef1677eb0bcbc08fe0c2aab2fe05c0514a323b463 /fs/bcachefs/btree_io.c
parentbcachefs: Check btree ptr min_key in .invalid (diff)
downloadlinux-812a9297936a959c98a2e9e44a9a622bbe30b162.tar.xz
linux-812a9297936a959c98a2e9e44a9a622bbe30b162.zip
bcachefs: Fix btree node keys accounting in topology repair path
When dropping keys now outside a now because we're changing the node min/max, we need to redo the node's accounting as well. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_io.c')
-rw-r--r--fs/bcachefs/btree_io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_io.c b/fs/bcachefs/btree_io.c
index b85e2cd61c38..9c71e6fb9c41 100644
--- a/fs/bcachefs/btree_io.c
+++ b/fs/bcachefs/btree_io.c
@@ -654,6 +654,7 @@ void bch2_btree_node_drop_keys_outside_node(struct btree *b)
*/
bch2_bset_set_no_aux_tree(b, b->set);
bch2_btree_build_aux_trees(b);
+ b->nr = bch2_btree_node_count_keys(b);
struct bkey_s_c k;
struct bkey unpacked;