Commit 2c480a71 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Handle -EINTR bch2_migrate_index_update()

peek_slot() shouldn't return -EINTR when there's only a single live
iterator, but that's tricky to guarantee - we seem to be returning
-EINTR when we shouldn't, but it's easy enough to handle in the caller.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 41697f38
...@@ -69,19 +69,26 @@ static int bch2_migrate_index_update(struct bch_write_op *op) ...@@ -69,19 +69,26 @@ static int bch2_migrate_index_update(struct bch_write_op *op)
BTREE_ITER_SLOTS|BTREE_ITER_INTENT); BTREE_ITER_SLOTS|BTREE_ITER_INTENT);
while (1) { while (1) {
struct bkey_s_c k = bch2_btree_iter_peek_slot(iter); struct bkey_s_c k;
struct bkey_i *insert; struct bkey_i *insert;
struct bkey_i_extent *new = struct bkey_i_extent *new;
bkey_i_to_extent(bch2_keylist_front(keys));
BKEY_PADDED(k) _new, _insert; BKEY_PADDED(k) _new, _insert;
const union bch_extent_entry *entry; const union bch_extent_entry *entry;
struct extent_ptr_decoded p; struct extent_ptr_decoded p;
bool did_work = false; bool did_work = false;
int nr; int nr;
bch2_trans_reset(&trans, 0);
k = bch2_btree_iter_peek_slot(iter);
ret = bkey_err(k); ret = bkey_err(k);
if (ret) if (ret) {
if (ret == -EINTR)
continue;
break; break;
}
new = bkey_i_to_extent(bch2_keylist_front(keys));
if (bversion_cmp(k.k->version, new->k.version) || if (bversion_cmp(k.k->version, new->k.version) ||
!bch2_bkey_matches_ptr(c, k, m->ptr, m->offset)) !bch2_bkey_matches_ptr(c, k, m->ptr, m->offset))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment