bcachefs: Fix a btree iterator leak

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2021-03-15 21:18:50 -04:00 committed by Kent Overstreet
parent 87a432f5d7
commit 57447b7acc
2 changed files with 5 additions and 3 deletions

View File

@ -1992,7 +1992,7 @@ static void btree_trans_iter_alloc_fail(struct btree_trans *trans)
char buf[100];
trans_for_each_iter(trans, iter)
printk(KERN_ERR "iter: btree %s pos %s%s%s%s %ps\n",
printk(KERN_ERR "iter: btree %s pos %s%s%s%s %pS\n",
bch2_btree_ids[iter->btree_id],
(bch2_bpos_to_text(&PBUF(buf), iter->pos), buf),
btree_iter_live(trans, iter) ? " live" : "",

View File

@ -157,8 +157,10 @@ static int bch2_make_extent_indirect(struct btree_trans *trans,
bch2_trans_update(trans, reflink_iter, r_v, 0);
r_p = bch2_trans_kmalloc(trans, sizeof(*r_p));
if (IS_ERR(r_p))
return PTR_ERR(r_p);
if (IS_ERR(r_p)) {
ret = PTR_ERR(r_p);
goto err;
}
orig->k.type = KEY_TYPE_reflink_p;
r_p = bkey_i_to_reflink_p(orig);