bcachefs: Don't reuse reflink btree keyspace
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 26 May 2023 03:37:06 +0000 (23:37 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:10:02 +0000 (17:10 -0400)
commitfc0ee376bb5b08844198fba13fb809102afd0b29
tree30660fa3bae2e4b4fb72d7c835837d4f01800c55
parentdb32bb9a5fd6bd7c7031b4b9d6c9a5e27b651e5d
bcachefs: Don't reuse reflink btree keyspace

We've been seeing difficult to debug "missing indirect extent" bugs,
that fsck doesn't seem to find.

One possibility is that there was a missing indirect extent, but then a
new indirect extent was created at the location of the previous indirect
extent.

This patch eliminates that possibility by always creating new indirect
extents right after the last one, at the end of the reflink btree.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/bcachefs.h
fs/bcachefs/reflink.c