summaryrefslogtreecommitdiff
path: root/fs/bcachefs/btree_iter.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-02-18 19:29:33 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:35 -0400
commitb606c8aa568e9f4f10f1b7504f8b96628d933a0e (patch)
tree483452d57294eb5781adbe4320d446ad0c62c80c /fs/bcachefs/btree_iter.c
parenta9bc0a5173bb9c30d0073ccf39b10e26d2f96ecf (diff)
downloadlwn-b606c8aa568e9f4f10f1b7504f8b96628d933a0e.tar.gz
lwn-b606c8aa568e9f4f10f1b7504f8b96628d933a0e.zip
bcachefs: Fix traversing to interior nodes
NULL is used to mean "reach end of traversal" - we were only initializing the leaf node in the iterator to the right sentinal value. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_iter.c')
-rw-r--r--fs/bcachefs/btree_iter.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c
index f002ddc18cbb..bf68ab7257ce 100644
--- a/fs/bcachefs/btree_iter.c
+++ b/fs/bcachefs/btree_iter.c
@@ -1732,8 +1732,7 @@ static inline void bch2_btree_iter_init(struct btree_trans *trans,
iter->nodes_locked = 0;
iter->nodes_intent_locked = 0;
for (i = 0; i < ARRAY_SIZE(iter->l); i++)
- iter->l[i].b = NULL;
- iter->l[iter->level].b = BTREE_ITER_NO_NODE_INIT;
+ iter->l[i].b = BTREE_ITER_NO_NODE_INIT;
prefetch(c->btree_roots[btree_id].b);
}