summaryrefslogtreecommitdiff
path: root/fs/bcachefs/extent_update.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-05-15 04:45:08 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:39 +0300
commit0d0e77f45fe806a80af76501d5422437692e158b (patch)
tree3423292046afe387d7ff945caa9d28fa87d5a2c9 /fs/bcachefs/extent_update.c
parentd3baf289dce56f78700ca9dc64153263652c9a0a (diff)
downloadlinux-0d0e77f45fe806a80af76501d5422437692e158b.tar.xz
bcachefs: Fix another iterator counting bug
We were marking the end of where we could insert incorrectly for indirect extents. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/extent_update.c')
-rw-r--r--fs/bcachefs/extent_update.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/extent_update.c b/fs/bcachefs/extent_update.c
index d0af1bc17018..fd011df3cb99 100644
--- a/fs/bcachefs/extent_update.c
+++ b/fs/bcachefs/extent_update.c
@@ -76,7 +76,8 @@ static int count_iters_for_insert(struct btree_trans *trans,
if (*nr_iters >= max_iters) {
struct bpos pos = bkey_start_pos(k.k);
- pos.offset += r_k.k->p.offset - idx;
+ pos.offset += min_t(u64, k.k->size,
+ r_k.k->p.offset - idx);
*end = bpos_min(*end, pos);
ret = 1;