Commit 1c8cc24e authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix incorrect error handling found_btree_node_is_readable()

error handling here is slightly odd, which is why we were accidently
calling evict() on an error pointer
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 161f73c2
......@@ -72,10 +72,11 @@ static bool found_btree_node_is_readable(struct btree_trans *trans,
struct btree *b = bch2_btree_node_get_noiter(trans, &k.k, f->btree_id, f->level, false);
bool ret = !IS_ERR_OR_NULL(b);
if (ret) {
if (!ret)
return ret;
f->sectors_written = b->written;
six_unlock_read(&b->c.lock);
}
/*
* We might update this node's range; if that happens, we need the node
......
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