Commit 4437590d authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix btree iter leak in __bch2_insert_snapshot_whiteouts()

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 2a89a3e9
...@@ -1327,7 +1327,7 @@ int __bch2_insert_snapshot_whiteouts(struct btree_trans *trans, ...@@ -1327,7 +1327,7 @@ int __bch2_insert_snapshot_whiteouts(struct btree_trans *trans,
struct bpos new_pos) struct bpos new_pos)
{ {
struct bch_fs *c = trans->c; struct bch_fs *c = trans->c;
struct btree_iter old_iter, new_iter; struct btree_iter old_iter, new_iter = { NULL };
struct bkey_s_c old_k, new_k; struct bkey_s_c old_k, new_k;
snapshot_id_list s; snapshot_id_list s;
struct bkey_i *update; struct bkey_i *update;
...@@ -1377,6 +1377,7 @@ int __bch2_insert_snapshot_whiteouts(struct btree_trans *trans, ...@@ -1377,6 +1377,7 @@ int __bch2_insert_snapshot_whiteouts(struct btree_trans *trans,
if (ret) if (ret)
break; break;
} }
bch2_trans_iter_exit(trans, &new_iter);
bch2_trans_iter_exit(trans, &old_iter); bch2_trans_iter_exit(trans, &old_iter);
darray_exit(&s); darray_exit(&s);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment