]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bcachefs: Repair pass for scanning for btree nodes
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 12 Mar 2024 03:11:46 +0000 (23:11 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Wed, 3 Apr 2024 18:44:18 +0000 (14:44 -0400)
commit4409b8081d1624af814a9cda781ad9cdda3973cb
tree22adb020d08b6c1d257465ab7c78bbeaa19df4cf
parentb268aa4e7fb8be3c50e25a09008fb2feed2cd345
bcachefs: Repair pass for scanning for btree nodes

If a btree root or interior btree node goes bad, we're going to lose a
lot of data, unless we can recover the nodes that it pointed to by
scanning.

Fortunately btree node headers are fully self describing, and
additionally the magic number is xored with the filesytem UUID, so we
can do so safely.

This implements the scanning - next patch will rework topology repair to
make use of the found nodes.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
12 files changed:
fs/bcachefs/Makefile
fs/bcachefs/bcachefs.h
fs/bcachefs/btree_node_scan.c [new file with mode: 0644]
fs/bcachefs/btree_node_scan.h [new file with mode: 0644]
fs/bcachefs/btree_node_scan_types.h [new file with mode: 0644]
fs/bcachefs/extents.c
fs/bcachefs/extents.h
fs/bcachefs/opts.h
fs/bcachefs/recovery.c
fs/bcachefs/recovery_passes.c
fs/bcachefs/recovery_passes_types.h
fs/bcachefs/super.c