bcachefs: Fix bch2_bkey_narrow_crcs()
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 21 Aug 2019 22:55:07 +0000 (18:55 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:25 +0000 (17:08 -0400)
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>
fs/bcachefs/extents.c

index 779ee42350ad9e97f5df0bd0b8e55658bb919ba2..f097bed684e5cdbdb11bffffadae47ed799e2350 100644 (file)
@@ -454,6 +454,8 @@ found:
        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);