Skip to content

Commit

Permalink
bcachefs: Fix another iterator counting bug
Browse files Browse the repository at this point in the history
We were marking the end of where we could insert incorrectly for
indirect extents.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
  • Loading branch information
koverstreet committed May 15, 2020
1 parent 91fedfc commit e1f6739
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/bcachefs/extent_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e1f6739

Please sign in to comment.