]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bcachefs: Disk accounting device validation fixes
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 7 Oct 2024 22:04:21 +0000 (18:04 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Wed, 9 Oct 2024 20:42:53 +0000 (16:42 -0400)
commit19773ec997201a45b3a1b5f1171897cba0f30bab
tree21eb096566543d8aa269f9ba7eb90e758e5a68af
parent9d86178782a25fac105e550e1c29c7d3f8470116
bcachefs: Disk accounting device validation fixes

- Fix failure to validate that accounting replicas entries point to
  valid devices: this wasn't a real bug since they'd be cleaned up by
  GC, but is still something we should know about

- Fix failure to validate that dev_data_type entries point to valid
  devices: this does fix a real bug, since bch2_accounting_read() would
  then try to copy the counters to that device and pop an inconsistent
  error when the device didn't exist

- Remove accounting entries that are zeroed or invalid: if we're not
  validating them we need to get rid of them: they might not exist in
  the superblock, so we need the to trigger the superblock mark path
  when they're readded.

  This fixes the replication.ktest rereplicate test, which was failing
  with "superblock not marked for replicas..."

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/disk_accounting.c
fs/bcachefs/errcode.h
fs/bcachefs/sb-errors_format.h