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 <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2023-09-26 17:21:21 -04:00
parent 1ee608c65d
commit 7dcf62c06d
1 changed files with 4 additions and 5 deletions

View File

@ -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;
}
}