Two patches for tracking errors a filesystem has seen since creation: - per-device IO error counts were requested recently; members_v2 made adding this easy. We have separate counters for read, write and checksum errors, ZFS style.
- personal wishlist item of mine for some time: enumarate all distinct fcsk errors and add persistent counters for them, so that show-super can show what inconsistencies have been getting found and fixed. In my experience, users will often not report issues that fsck can repair - but I still want to know about them, as generally speaking anything fsck needed to repair resulted from a filesystem bug. I might add a bit of telemetry for this, so that I know what bugs I still need to be looking for :) There's another patch in the series after this that plumbs the new BCH_SB_ERR codes into fsck_err() - not mailing that patch to the list because it's massive. Cheers, Kent Kent Overstreet (2): bcachefs: Add IO error counts to bch_member bcachefs: bch_sb_field_errors fs/bcachefs/Makefile | 1 + fs/bcachefs/bcachefs.h | 16 +++- fs/bcachefs/bcachefs_format.h | 27 +++++- fs/bcachefs/btree_io.c | 6 +- fs/bcachefs/ec.c | 6 +- fs/bcachefs/errcode.h | 1 + fs/bcachefs/error.c | 25 ++--- fs/bcachefs/error.h | 10 +- fs/bcachefs/io_read.c | 4 +- fs/bcachefs/io_write.c | 2 +- fs/bcachefs/journal_io.c | 5 +- fs/bcachefs/opts.c | 5 - fs/bcachefs/opts.h | 1 - fs/bcachefs/sb-errors.c | 175 ++++++++++++++++++++++++++++++++++ fs/bcachefs/sb-errors.h | 26 +++++ fs/bcachefs/sb-errors_types.h | 16 ++++ fs/bcachefs/sb-members.c | 70 ++++++++++---- fs/bcachefs/sb-members.h | 41 +++++++- fs/bcachefs/super-io.c | 12 ++- fs/bcachefs/super-io.h | 40 +------- fs/bcachefs/super.c | 17 +++- fs/bcachefs/sysfs.c | 27 +++++- 22 files changed, 430 insertions(+), 103 deletions(-) create mode 100644 fs/bcachefs/sb-errors.c create mode 100644 fs/bcachefs/sb-errors.h create mode 100644 fs/bcachefs/sb-errors_types.h -- 2.42.0
