]> www.infradead.org Git - users/dwmw2/linux.git/commit
bcachefs: Don't delete reflink pointers to missing indirect extents
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 21 Oct 2024 00:27:44 +0000 (20:27 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 21 Dec 2024 06:36:18 +0000 (01:36 -0500)
commit7579c85d9cc3b25c7969474e9662f2d1c1130ab8
tree7604f1f4a10893e2365b5fd0c8c76e7c195d033f
parent3d338378d76391bb98a18e3cfb154a539866d0cf
bcachefs: Don't delete reflink pointers to missing indirect extents

To avoid tragic loss in the event of transient errors (i.e., a btree
node topology error that was later corrected by btree node scan), we
can't delete reflink pointers to correct errors.

This adds a new error bit to bch_reflink_p, indicating that it is known
to point to a missing indirect extent, and the error has already been
reported.

Indirect extent lookups now use bch2_lookup_indirect_extent(), which on
error reports it as a fsck_err() and sets the error bit, and clears it
if necessary on succesful lookup.

This also gets rid of the bch2_inconsistent_error() call in
__bch2_read_indirect_extent, and in the reflink_p trigger: part of the
online self healing project.

An on disk format change isn't necessary here: setting the error bit
will be interpreted by older versions as pointing to a different index,
which will also be missing - which is fine.

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