VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   30 Branches   50 Tags
author: Zheng Wang <zyytlz.wz@163.com> 2023-06-15 20:12:22 +0800 committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2023-07-19 16:36:53 +0200 commit: 4514847aee18d9391a0cf3aad75d3567c72795a4 parent: 0cabf9e164660e8d66c4810396046383a1110a69
Commit Summary:
bcache: Fix __bch_btree_node_alloc to make the failure behavior consistent
Diffstat:
1 file changed, 3 insertions, 1 deletion
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index d7b5dd886a15..68b9d7ca864e 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -1090,10 +1090,12 @@ struct btree *__bch_btree_node_alloc(struct cache_set *c, struct btree_op *op,
 				     struct btree *parent)
 {
 	BKEY_PADDED(key) k;
-	struct btree *b = ERR_PTR(-EAGAIN);
+	struct btree *b;
 
 	mutex_lock(&c->bucket_lock);
 retry:
+	/* return ERR_PTR(-EAGAIN) when it fails */
+	b = ERR_PTR(-EAGAIN);
 	if (__bch_bucket_alloc_set(c, RESERVE_BTREE, &k.key, wait))
 		goto err;