bcachefs: Fix a btree iterator leak

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
Kent Overstreet 2021-07-24 20:20:02 -04:00 committed by Kent Overstreet
parent d7b21954b9
commit ed5580b43b

View File

@ -858,8 +858,10 @@ static int extent_handle_overwrites(struct btree_trans *trans,
BTREE_ITER_NOT_EXTENTS|
BTREE_ITER_INTENT);
ret = bch2_btree_iter_traverse(update_iter);
if (ret)
if (ret) {
bch2_trans_iter_put(trans, update_iter);
goto out;
}
bch2_trans_update(trans, update_iter, update,
BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE|