]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bcachefs: Fix error handling in bch2_btree_node_prefetch()
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 27 Oct 2024 22:25:30 +0000 (18:25 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 7 Nov 2024 21:48:20 +0000 (16:48 -0500)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_cache.c

index 6e4afb2b54413bf67c06e1d42a3f596c358d647c..6f6225703eef2ed952e687962631607a7b499497 100644 (file)
@@ -1312,9 +1312,12 @@ int bch2_btree_node_prefetch(struct btree_trans *trans,
 
        b = bch2_btree_node_fill(trans, path, k, btree_id,
                                 level, SIX_LOCK_read, false);
-       if (!IS_ERR_OR_NULL(b))
+       int ret = PTR_ERR_OR_ZERO(b);
+       if (ret)
+               return ret;
+       if (b)
                six_unlock_read(&b->c.lock);
-       return bch2_trans_relock(trans) ?: PTR_ERR_OR_ZERO(b);
+       return 0;
 }
 
 void bch2_btree_node_evict(struct btree_trans *trans, const struct bkey_i *k)