Commit 5f87f3c1 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Don't downgrade in traverse()

Downgrading of btree iterators is something that should only happen
explicitly.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent e719fc34
......@@ -341,12 +341,10 @@ int bch2_btree_iter_traverse_cached(struct btree_iter *iter)
iter->uptodate = BTREE_ITER_NEED_PEEK;
if (!(iter->flags & BTREE_ITER_INTENT))
bch2_btree_iter_downgrade(iter);
else if (!iter->locks_want) {
if (!__bch2_btree_iter_upgrade(iter, 1))
if ((iter->flags & BTREE_ITER_INTENT) &&
!iter->locks_want &&
__bch2_btree_iter_upgrade(iter, 1))
ret = -EINTR;
}
return ret;
err:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment