Skip to content

Commit 72acab3

Browse files
author
Kent Overstreet
committed
bcachefs: Fix error handling in bch2_btree_node_prefetch()
Signed-off-by: Kent Overstreet <[email protected]>
1 parent fd00045 commit 72acab3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fs/bcachefs/btree_cache.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,9 +1312,12 @@ int bch2_btree_node_prefetch(struct btree_trans *trans,
13121312

13131313
b = bch2_btree_node_fill(trans, path, k, btree_id,
13141314
level, SIX_LOCK_read, false);
1315-
if (!IS_ERR_OR_NULL(b))
1315+
int ret = PTR_ERR_OR_ZERO(b);
1316+
if (ret)
1317+
return ret;
1318+
if (b)
13161319
six_unlock_read(&b->c.lock);
1317-
return bch2_trans_relock(trans) ?: PTR_ERR_OR_ZERO(b);
1320+
return 0;
13181321
}
13191322

13201323
void bch2_btree_node_evict(struct btree_trans *trans, const struct bkey_i *k)

0 commit comments

Comments
 (0)