mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 16:54:20 +08:00
bcache: Do bkey_put() in btree_split() error path
This error path shouldn't have been hit in practice.. and we've got reworked reserve code coming soon so that it shouldn't _ever_ be bit... but if we've got code for this error path it should be correct. Signed-off-by: Kent Overstreet <kmo@daterainc.com>
This commit is contained in:
parent
78365411b3
commit
5f5837d2d6
@ -2191,18 +2191,21 @@ static int btree_split(struct btree *b, struct btree_op *op,
|
||||
|
||||
return 0;
|
||||
err_free2:
|
||||
bkey_put(b->c, &n2->key);
|
||||
btree_node_free(n2);
|
||||
rw_unlock(true, n2);
|
||||
err_free1:
|
||||
bkey_put(b->c, &n1->key);
|
||||
btree_node_free(n1);
|
||||
rw_unlock(true, n1);
|
||||
err:
|
||||
WARN(1, "bcache: btree split failed");
|
||||
|
||||
if (n3 == ERR_PTR(-EAGAIN) ||
|
||||
n2 == ERR_PTR(-EAGAIN) ||
|
||||
n1 == ERR_PTR(-EAGAIN))
|
||||
return -EAGAIN;
|
||||
|
||||
pr_warn("couldn't split");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user