bcachefs: Fix bch2_bkey_narrow_crcs()

We have to reinitialize ptrs whenever we do something that changes them.
Regression from when the code was converted to be generic across all
keys with pointers.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2019-08-21 18:55:07 -04:00 committed by Kent Overstreet
parent e42951b0aa
commit f698a95797

View file

@ -454,6 +454,8 @@ bool bch2_bkey_narrow_crcs(struct bkey_i *k, struct bch_extent_crc_unpacked n)
BUG_ON(n.live_size != k->k.size);
restart_narrow_pointers:
ptrs = bch2_bkey_ptrs(bkey_i_to_s(k));
bkey_for_each_ptr_decode(&k->k, ptrs, p, i)
if (can_narrow_crc(p.crc, n)) {
bch2_bkey_drop_ptr(bkey_i_to_s(k), &i->ptr);