Skip to content

Commit

Permalink
bcachefs: Fix infinite loop in propagate_key_to_snapshot_leaves()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Kent Overstreet committed Sep 23, 2024
1 parent 6d12d7a commit 7eb4a31
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/bcachefs/snapshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1784,6 +1784,7 @@ static int bch2_propagate_key_to_snapshot_leaf(struct btree_trans *trans,
new->k.p.snapshot = leaf_id;
ret = bch2_trans_update(trans, &iter, new, 0);
out:
bch2_set_btree_iter_dontneed(&iter);
bch2_trans_iter_exit(trans, &iter);
return ret;
}
Expand Down

0 comments on commit 7eb4a31

Please sign in to comment.