mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 07:04:44 +00:00
bcachefs: Fix an iterator counting bug
The iterator counting assumed we're doing an obvious optimization when only updating the refcount on indirect extents - but we're not doing it yet. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
ae93a62895
commit
71603f1ffe
1 changed files with 1 additions and 14 deletions
|
@ -971,20 +971,7 @@ static int count_iters_for_insert(struct btree_trans *trans,
|
|||
POS(0, idx + sectors)) >= 0)
|
||||
break;
|
||||
|
||||
*nr_iters += 1;
|
||||
|
||||
if (overwrite &&
|
||||
r_k.k->type == KEY_TYPE_reflink_v) {
|
||||
struct bkey_s_c_reflink_v r = bkey_s_c_to_reflink_v(r_k);
|
||||
|
||||
if (le64_to_cpu(r.v->refcount) == 1)
|
||||
*nr_iters += bch2_bkey_nr_alloc_ptrs(r_k);
|
||||
}
|
||||
|
||||
/*
|
||||
* if we're going to be deleting an entry from
|
||||
* the reflink btree, need more iters...
|
||||
*/
|
||||
*nr_iters += 1 + bch2_bkey_nr_alloc_ptrs(r_k);
|
||||
|
||||
if (*nr_iters >= max_iters) {
|
||||
struct bpos pos = bkey_start_pos(k.k);
|
||||
|
|
Loading…
Reference in a new issue