bcachefs: bch_sb_field_downgrade
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 29 Dec 2023 20:25:07 +0000 (15:25 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 1 Jan 2024 16:47:07 +0000 (11:47 -0500)
commit84f1638795da1ff2084597de4251e9054f1ad728
treee3624d44235472e8d3e170af4a53686cfa5a945f
parent8b16413cda7c46d47f8071165b3071f8a9369199
bcachefs: bch_sb_field_downgrade

Add a new superblock section that contains a list of
  { minor version, recovery passes, errors_to_fix }

that is - a list of recovery passes that must be run when downgrading
past a given version, and a list of errors to silently fix.

The upcoming disk accounting rewrite is not going to be fully
compatible: we're going to have to regenerate accounting both when
upgrading to the new version, and also from downgrading from the new
version, since the new method of doing disk space accounting is a
completely different architecture based on deltas, and synchronizing
them for every jounal entry write to maintain compatibility is going to
be too expensive and impractical.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/Makefile
fs/bcachefs/bcachefs_format.h
fs/bcachefs/errcode.h
fs/bcachefs/recovery.c
fs/bcachefs/sb-clean.c
fs/bcachefs/sb-downgrade.c [new file with mode: 0644]
fs/bcachefs/sb-downgrade.h [new file with mode: 0644]
fs/bcachefs/sb-errors.c
fs/bcachefs/super-io.c
fs/bcachefs/super-io.h