diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-10-27 18:25:30 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-11-07 16:48:20 -0500 |
commit | 72acab3a7c5aee76451fa6054e9608026476a971 (patch) | |
tree | 3c13b41728d650ad4305615f148e4d7d003f1e6e /fs | |
parent | fd00045f383f51b66a7a46084a0e92b8de563157 (diff) |
bcachefs: Fix error handling in bch2_btree_node_prefetch()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bcachefs/btree_cache.c | 7 |
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) |