Skip to content

Commit 7eb4a31

Browse files
author
Kent Overstreet
committed
bcachefs: Fix infinite loop in propagate_key_to_snapshot_leaves()
As we iterate we need to mark that we no longer need iterators - otherwise we'll infinite loop via the "too many iters" check when there's many snapshots. Signed-off-by: Kent Overstreet <[email protected]>
1 parent 6d12d7a commit 7eb4a31

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/bcachefs/snapshot.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,6 +1784,7 @@ static int bch2_propagate_key_to_snapshot_leaf(struct btree_trans *trans,
17841784
new->k.p.snapshot = leaf_id;
17851785
ret = bch2_trans_update(trans, &iter, new, 0);
17861786
out:
1787+
bch2_set_btree_iter_dontneed(&iter);
17871788
bch2_trans_iter_exit(trans, &iter);
17881789
return ret;
17891790
}

0 commit comments

Comments
 (0)