return 0;
iter = bch2_trans_copy_iter(trans, h->chain);
- BUG_ON(IS_ERR(iter));
for_each_btree_key_continue(iter, 0, k2, ret) {
if (bkey_cmp(k2.k->p, k.k->p) >= 0)
hash_stop_chain(trans, h);
if (!hole) {
- if (!h->chain) {
+ if (!h->chain)
h->chain = bch2_trans_copy_iter(trans, k_iter);
- BUG_ON(IS_ERR(h->chain));
- }
h->chain_end = k.k->p.offset;
}
bch2_cut_front(cut_at, u);
u_iter = bch2_trans_copy_iter(trans, iter);
- ret = PTR_ERR_OR_ZERO(u_iter);
- if (ret)
- return ret;
/*
* We don't want to go through the
BTREE_ITER_INTENT);
retry:
for_each_btree_key_continue(iter, 0, k, ret) {
- if (bkey_cmp(prev.k->k.p, bkey_start_pos(k.k)) > 0) {
+ /*
+ * due to retry errors we might see the same extent twice:
+ */
+ if (bkey_cmp(prev.k->k.p, k.k->p) &&
+ bkey_cmp(prev.k->k.p, bkey_start_pos(k.k)) > 0) {
char buf1[200];
char buf2[200];