mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
bcachefs: Fix failure to read btree roots
If failed to read a btree root - or if we're not using a btree root, because of the reconstruct_alloc option - make sure we update the corresponding info for the key/level for the root on disk. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
3277081522
commit
806c8a6aa8
1 changed files with 8 additions and 2 deletions
|
@ -974,9 +974,15 @@ static int read_btree_roots(struct bch_fs *c)
|
|||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < BTREE_ID_NR; i++)
|
||||
if (!c->btree_roots[i].b)
|
||||
for (i = 0; i < BTREE_ID_NR; i++) {
|
||||
struct btree_root *r = &c->btree_roots[i];
|
||||
|
||||
if (!r->b) {
|
||||
r->alive = false;
|
||||
r->level = 0;
|
||||
bch2_btree_root_alloc(c, i);
|
||||
}
|
||||
}
|
||||
fsck_err:
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue