bcachefs: Don't drop ptrs to btree nodes
authorKent Overstreet <kent.overstreet@gmail.com>
Fri, 16 Apr 2021 22:59:54 +0000 (18:59 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:54 +0000 (17:08 -0400)
commit006d69aa2655f1a0ca4e47666939669f27bb740f
treeb286d766a03906654fb987a411defe52268f8347
parentd065472c3a7966b5104cce6901f329250f629758
bcachefs: Don't drop ptrs to btree nodes

If a ptr gen doesn't match the bucket gen, the bucket likely doesn't
contain the data we want - but it's still possible the data we want
might have been overwritten, and for btree node pointers we can verify
whether or not the node is the one we wanted with the node's sequence
number, so it's better to keep the pointer and try reading from it.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_gc.c
fs/bcachefs/btree_io.c