summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-09-23 16:39:49 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-09-23 18:46:58 -0400
commit7eb4a319db65566005989121563ead344ca79140 (patch)
tree99a05d4556edfd063f733281eb6d205e45e59664
parent6d12d7ace99ec74cb1f479bb851b5ed65b3bc105 (diff)
downloadlinux-stable-7eb4a319db65566005989121563ead344ca79140.tar.gz
linux-stable-7eb4a319db65566005989121563ead344ca79140.tar.bz2
linux-stable-7eb4a319db65566005989121563ead344ca79140.zip
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 <kent.overstreet@linux.dev>
-rw-r--r--fs/bcachefs/snapshot.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/snapshot.c b/fs/bcachefs/snapshot.c
index dff83ebbd912..1809442b00ee 100644
--- a/fs/bcachefs/snapshot.c
+++ b/fs/bcachefs/snapshot.c
@@ -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;
}