summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/btree_cache.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-10-27 23:25:30 +0100
committerKent Overstreet <kent.overstreet@linux.dev>2024-11-07 22:48:20 +0100
commit72acab3a7c5aee76451fa6054e9608026476a971 (patch)
tree3c13b41728d650ad4305615f148e4d7d003f1e6e /fs/bcachefs/btree_cache.c
parentbcachefs: Fix null ptr deref in bucket_gen_get() (diff)
downloadlinux-72acab3a7c5aee76451fa6054e9608026476a971.tar.xz
linux-72acab3a7c5aee76451fa6054e9608026476a971.zip
bcachefs: Fix error handling in bch2_btree_node_prefetch()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to '')
-rw-r--r--fs/bcachefs/btree_cache.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/bcachefs/btree_cache.c b/fs/bcachefs/btree_cache.c
index 6e4afb2b5441..6f6225703eef 100644
--- a/fs/bcachefs/btree_cache.c
+++ b/fs/bcachefs/btree_cache.c
@@ -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)