summaryrefslogtreecommitdiff
path: root/fs/bcachefs/error.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-04-24 23:32:35 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:02 +0300
commitaae15aafcd43ec5346ac6c3f61c09798d26593ee (patch)
tree49df821335528b7d153ea17f6cfaf99c72321f3b /fs/bcachefs/error.h
parent4932e07ea04bcc7f1649052183d1ebbab30c711c (diff)
downloadlinux-aae15aafcd43ec5346ac6c3f61c09798d26593ee.tar.xz
bcachefs: New and improved topology repair code
This splits out btree topology repair into a separate pass, and makes some improvements: - When we have to pick which of two overlapping nodes to drop keys from, we use the btree node header sequence number to preserve the newer node - the gc code has been changed so that it doesn't bail out if we're continuing/ignoring on fsck error - this way the dump tool can skip running the repair pass but still walk all reachable metadata - add a new superblock flag indicating when a filesystem is known to have btree topology issues, and the topology repair pass should be run - changing the start/end of a node might mean keys in that node have to be deleted: this patch handles that better by splitting it out into a separate function and running it explicitly in the topology repair code, previously those keys were only being dropped when the btree node was read in. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/error.h')
-rw-r--r--fs/bcachefs/error.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/error.h b/fs/bcachefs/error.h
index 0e49fd728e44..d8cd19b3f63c 100644
--- a/fs/bcachefs/error.h
+++ b/fs/bcachefs/error.h
@@ -29,6 +29,8 @@ struct work_struct;
bool bch2_inconsistent_error(struct bch_fs *);
+void bch2_topology_error(struct bch_fs *);
+
#define bch2_fs_inconsistent(c, ...) \
({ \
bch_err(c, __VA_ARGS__); \
@@ -88,6 +90,7 @@ enum fsck_err_ret {
FSCK_ERR_IGNORE = 0,
FSCK_ERR_FIX = 1,
FSCK_ERR_EXIT = 2,
+ FSCK_ERR_START_TOPOLOGY_REPAIR = 3,
};
struct fsck_err_state {