mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-29 09:12:07 +00:00
bcachefs: Ignore empty btree root journal entries
There's no reason to treat them as errors: just ignore them, and go with a previous btree root if we had one. Reported-by: syzbot+e22007d6acb9c87c2362@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
33213a5be1
commit
aa492d5318
@ -442,7 +442,9 @@ static int journal_replay_entry_early(struct bch_fs *c,
|
||||
|
||||
switch (entry->type) {
|
||||
case BCH_JSET_ENTRY_btree_root: {
|
||||
struct btree_root *r;
|
||||
|
||||
if (unlikely(!entry->u64s))
|
||||
return 0;
|
||||
|
||||
if (fsck_err_on(entry->btree_id >= BTREE_ID_NR_MAX,
|
||||
c, invalid_btree_id,
|
||||
@ -456,15 +458,11 @@ static int journal_replay_entry_early(struct bch_fs *c,
|
||||
return ret;
|
||||
}
|
||||
|
||||
r = bch2_btree_id_root(c, entry->btree_id);
|
||||
struct btree_root *r = bch2_btree_id_root(c, entry->btree_id);
|
||||
|
||||
if (entry->u64s) {
|
||||
r->level = entry->level;
|
||||
bkey_copy(&r->key, (struct bkey_i *) entry->start);
|
||||
r->error = 0;
|
||||
} else {
|
||||
r->error = -BCH_ERR_btree_node_read_error;
|
||||
}
|
||||
r->level = entry->level;
|
||||
bkey_copy(&r->key, (struct bkey_i *) entry->start);
|
||||
r->error = 0;
|
||||
r->alive = true;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user