bcachefs: Allow for unknown btree IDs
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 29 Jun 2023 02:09:13 +0000 (22:09 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:10:05 +0000 (17:10 -0400)
commitfaa6cb6c13c7223240366ebbf0217a6191fbfc32
treec41d92045b9cdd9f84c1f0188ab4d7311796c2bc
parentbc652905c60b504ded266448b2810242d24c8d88
bcachefs: Allow for unknown btree IDs

We need to allow filesystems with metadata from newer versions to be
mountable and usable by older versions.

This patch enables us to roll out new btrees without a new major version
number; we can now handle btree roots for unknown btree types.

The unknown btree roots will be retained, and fsck (including
backpointers) will check them, the same as other btree types.

We add a dynamic array for the extra, unknown btree roots, in addition
to the fixed size btree root array, and add new helpers for looking up
btree roots.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/backpointers.c
fs/bcachefs/bcachefs.h
fs/bcachefs/btree_cache.c
fs/bcachefs/btree_cache.h
fs/bcachefs/btree_gc.c
fs/bcachefs/btree_io.c
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_update_interior.c
fs/bcachefs/move.c
fs/bcachefs/recovery.c
fs/bcachefs/super.c