]> git.ipfire.org Git - thirdparty/linux.git/commit
bcachefs: Checksum errors get additional retries
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 8 Mar 2025 17:56:43 +0000 (12:56 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 16 Mar 2025 17:47:55 +0000 (13:47 -0400)
commitbe31e412ac01f49bf7afa8eaa93dac399914a0a1
tree98eddda0e3b8abfa2fb4d19472e78a210a72a4dd
parentccba9029b01cdcc1aa6f3ed6375efdc0d779cc8f
bcachefs: Checksum errors get additional retries

It's possible for checksum errors to be transient - e.g. flakey
controller or cable, thus we need additional retries (besides retrying
from different replicas) before we can definitely return an error.

This is particularly important for the next patch, which will allow the
data move path to move extents with checksum errors - we don't want to
accidentally introduce bitrot due to a transient error!

- bch2_bkey_pick_read_device() is substantially reworked, and
  bch2_dev_io_failures is expanded to record more information about the
  type of failure (i.e. number of checksum errors).

  It now returns an error code that describes more precisely the reason
  for the failure - checksum error, io error, or offline device, instead
  of the previous generic "insufficient devices". This is important for
  the next patches that add poisoning, as we only want to poison extents
  when we've got real checksum errors (or perhaps IO errors?) - not
  because a device was offline.

- Add a new option and superblock field for the number of checksum
  retries.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/bcachefs_format.h
fs/bcachefs/btree_io.c
fs/bcachefs/errcode.h
fs/bcachefs/extents.c
fs/bcachefs/extents.h
fs/bcachefs/extents_types.h
fs/bcachefs/io_read.c
fs/bcachefs/opts.h
fs/bcachefs/super-io.c