mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 07:04:24 +00:00
bcachefs: Don't error out when just reading the journal
This tweaks the recovery and journal paths so that we don't error out before we need to: the list_journal command should work, even if we wouldn't be able to replay successfully. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
6f90e6b281
commit
e0de429a3a
2 changed files with 8 additions and 9 deletions
|
@ -1187,8 +1187,7 @@ int bch2_journal_read(struct bch_fs *c, u64 *blacklist_seq, u64 *start_seq)
|
||||||
|
|
||||||
if (!last_seq) {
|
if (!last_seq) {
|
||||||
fsck_err(c, "journal read done, but no entries found after dropping non-flushes");
|
fsck_err(c, "journal read done, but no entries found after dropping non-flushes");
|
||||||
ret = -1;
|
return 0;
|
||||||
goto err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bch_info(c, "journal read done, replaying entries %llu-%llu",
|
bch_info(c, "journal read done, replaying entries %llu-%llu",
|
||||||
|
|
|
@ -1113,6 +1113,13 @@ int bch2_fs_recovery(struct bch_fs *c)
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* note: cmd_list_journal needs the blacklist table fully up to date so
|
||||||
|
* it can asterisk ignored journal entries:
|
||||||
|
*/
|
||||||
|
if (c->opts.read_journal_only)
|
||||||
|
goto out;
|
||||||
|
|
||||||
genradix_for_each_reverse(&c->journal_entries, iter, i)
|
genradix_for_each_reverse(&c->journal_entries, iter, i)
|
||||||
if (*i && !(*i)->ignore) {
|
if (*i && !(*i)->ignore) {
|
||||||
last_journal_entry = &(*i)->j;
|
last_journal_entry = &(*i)->j;
|
||||||
|
@ -1184,13 +1191,6 @@ int bch2_fs_recovery(struct bch_fs *c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* note: cmd_list_journal needs the blacklist table fully up to date so
|
|
||||||
* it can asterisk ignored journal entries:
|
|
||||||
*/
|
|
||||||
if (c->opts.read_journal_only)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
ret = bch2_fs_journal_start(&c->journal, journal_seq);
|
ret = bch2_fs_journal_start(&c->journal, journal_seq);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
Loading…
Reference in a new issue