From 7dcf62c06d11195e8caecd7b2236aa5b07e3ef8c Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 26 Sep 2023 17:21:21 -0400 Subject: [PATCH] bcachefs: Make btree root read errors recoverable The entire btree will be lost, but that is better than the entire filesystem not being recoverable. Signed-off-by: Kent Overstreet --- fs/bcachefs/recovery.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index 1dceb7eeb205..9dbaf080dcdd 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -374,13 +374,12 @@ static int read_btree_roots(struct bch_fs *c) ret = bch2_btree_root_read(c, i, &r->key, r->level); if (ret) { - __fsck_err(c, - btree_id_is_alloc(i) - ? FSCK_CAN_IGNORE : 0, - "error reading btree root %s", - bch2_btree_ids[i]); + fsck_err(c, + "error reading btree root %s", + bch2_btree_ids[i]); if (btree_id_is_alloc(i)) c->sb.compat &= ~(1ULL << BCH_COMPAT_alloc_info); + ret = 0; } }