Commit e5e6aaa7 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix ec_stripe_update_ptrs()

bch2_btree_iter_set_pos() invalidates the key returned by peek().
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent d06c1a0c
......@@ -804,8 +804,6 @@ static int ec_stripe_update_ptrs(struct bch_fs *c,
continue;
}
bch2_btree_iter_set_pos(iter, bkey_start_pos(k.k));
dev = s->key.v.ptrs[idx].dev;
bkey_on_stack_reassemble(&sk, c, k);
......@@ -820,6 +818,7 @@ static int ec_stripe_update_ptrs(struct bch_fs *c,
extent_stripe_ptr_add(e, s, ec_ptr, idx);
bch2_btree_iter_set_pos(iter, bkey_start_pos(&sk.k->k));
bch2_trans_update(&trans, iter, sk.k, 0);
ret = bch2_trans_commit(&trans, NULL, NULL,
......
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