Update bcachefs sources to fc4f1d59cf bcachefs: Fix an iterator counting bug

This commit is contained in:
Kent Overstreet 2019-10-16 14:13:07 -04:00
parent 6e696ea087
commit 3c810611c1
3 changed files with 5 additions and 15 deletions

View File

@ -1 +1 @@
de906c3e2eddad291d46bd0e7c81c68eaadcd08a
fc4f1d59cf9330bbb27cd12c459706aa5e7fe33c

View File

@ -1438,6 +1438,9 @@ again:
cond_resched();
nodes_unwritten = false;
if (bch2_journal_error(&c->journal))
return true;
rcu_read_lock();
for_each_cached_btree(b, c, tbl, i, pos)
if (btree_node_need_write(b)) {

View File

@ -972,20 +972,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);