summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-07-21 09:53:28 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:37 -0400
commit01eed77178049b85ec1850717fc81bcb24e19c70 (patch)
treee1eece55e352c5bcef5826ec7ce703eafdf26dd1
parentdb346e7120a6dec1534184ea2abf9d22edbb9b8a (diff)
downloadlinux-stable-01eed77178049b85ec1850717fc81bcb24e19c70.tar.gz
linux-stable-01eed77178049b85ec1850717fc81bcb24e19c70.tar.bz2
linux-stable-01eed77178049b85ec1850717fc81bcb24e19c70.zip
bcachefs: Tighten up btree_path assertions
Currently seeing a very rare and difficult to explain btree_path inconsistency - this patch adds assertions to the only place that seems to be missing them. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/btree_iter.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c
index 777e41a12246..01ca27ee6314 100644
--- a/fs/bcachefs/btree_iter.c
+++ b/fs/bcachefs/btree_iter.c
@@ -1020,6 +1020,7 @@ static inline struct bkey_s_c btree_path_level_peek(struct btree_trans *trans,
path->pos = k.k ? k.k->p : l->b->key.k.p;
trans->paths_sorted = false;
+ bch2_btree_path_verify_level(trans, path, l - path->l);
return k;
}
@@ -1033,6 +1034,7 @@ static inline struct bkey_s_c btree_path_level_prev(struct btree_trans *trans,
path->pos = k.k ? k.k->p : l->b->data->min_key;
trans->paths_sorted = false;
+ bch2_btree_path_verify_level(trans, path, l - path->l);
return k;
}
@@ -1661,7 +1663,7 @@ out:
int __must_check bch2_btree_path_traverse(struct btree_trans *trans,
struct btree_path *path, unsigned flags)
{
- if (IS_ENABLED(CONFIG_BCACHEFS_DEBUG)) {
+ if (0 && IS_ENABLED(CONFIG_BCACHEFS_DEBUG)) {
unsigned restart_probability_bits = 4 << min(trans->restart_count, 32U);
u64 max = ~(~0ULL << restart_probability_bits);