]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bcachefs: Poison extents that can't be read due to checksum errors
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 10 Mar 2025 18:03:25 +0000 (14:03 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 22 May 2025 00:13:19 +0000 (20:13 -0400)
commit760be1ad5e71b3a23644849cbf3c2245c4dc83f3
tree20f49fdaebccf6e09209b3ed178caf569a9310ac
parent6659ba3b18f71282c7c54f3bffcfecfac73f202f
bcachefs: Poison extents that can't be read due to checksum errors

Copygc needs to be able to move extents that have bitrotted. We don't
want to delete them - in the future we'll have an API for "read me the
data even if there's checksum errors", and in general we don't want to
delete anything unless the user asks us to.

That will require writing it with a new checksum, which means we can't
forget that there was a checksum error so we return the correct error to
userspace.

Rebalance also wants to skip bad extents; we can now use the poison flag
for that.

This is currently disabled by default, as we want read fua support so
that we can distinguish between transient and permanent errors from the
device. It may be enabled with the module parameter:

  poison_extents_on_checksum_error

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