]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bcachefs: Scrub
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 29 Dec 2024 00:59:55 +0000 (19:59 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 15 Mar 2025 01:02:12 +0000 (21:02 -0400)
commitf269ae55d2de9c6aff5b289cd94c8eaab7b9b2c3
tree571fcd20b005ef3b2be71a37a235b3ef5643dd09
parent3e2ad29865f279f7e9837e4eeb8518509e97333f
bcachefs: Scrub

Add a new data op to walk all data and metadata in a filesystem,
checking if it can be read successfully, and on error repairing from
another copy if possible.

- New helper: bch2_dev_idx_is_online(), so that we can bail out and
  report to userspace when we're unable to scrub because the device is
  offline

- data_update_opts, which controls the data move path, now understands
  scrub: data is only read, not written. The read path is responsible
  for rewriting on read error, as with other reads.

- scrub_pred skips data extents that don't have checksums

- bch_ioctl_data has a new scrub member, which has a data_types field
  for data types to check - i.e. all data types, or only metadata.

- Add new entries to bch_move_stats so that we can report numbers for
  corrected and uncorrected errors

- Add a new enum to bch_ioctl_data_event for explicitly reporting
  completion and return code (i.e. device offline)

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/bcachefs_ioctl.h
fs/bcachefs/chardev.c
fs/bcachefs/data_update.c
fs/bcachefs/data_update.h
fs/bcachefs/io_read.c
fs/bcachefs/io_read.h
fs/bcachefs/move.c
fs/bcachefs/move_types.h
fs/bcachefs/sb-members.h