mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-08 15:04:45 +00:00
bcachefs: fix btree iterator bug when using depth > 0
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
61274e9d45
commit
8812600c29
@ -818,7 +818,7 @@ static inline int btree_iter_lock_root(struct btree_iter *iter,
|
||||
*/
|
||||
iter->level = depth_want;
|
||||
iter->l[iter->level].b = NULL;
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
lock_type = __btree_lock_want(iter, iter->level);
|
||||
@ -1045,6 +1045,9 @@ int __must_check __bch2_btree_iter_traverse(struct btree_iter *iter)
|
||||
? btree_iter_down(iter)
|
||||
: btree_iter_lock_root(iter, depth_want);
|
||||
if (unlikely(ret)) {
|
||||
if (ret == 1)
|
||||
return 0;
|
||||
|
||||
iter->level = depth_want;
|
||||
iter->l[iter->level].b = BTREE_ITER_NOT_END;
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user