diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-06-13 18:43:14 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:41 -0400 |
commit | 7fffc85baf1fa176560a546a0625efc549969ce4 (patch) | |
tree | 4edec775eea6e753b6dd1772a4992bf9f664ab29 /fs/bcachefs/journal.c | |
parent | bd2bb273a09b93e2a7d79d30458ab5f6f0b3757a (diff) |
bcachefs: Add an internal option for reading entire journal
To be used the debug tool that dumps the contents of the journal.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal.c')
-rw-r--r-- | fs/bcachefs/journal.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c index 767cb6f809e7..cbfaec5143d8 100644 --- a/fs/bcachefs/journal.c +++ b/fs/bcachefs/journal.c @@ -986,9 +986,8 @@ int bch2_fs_journal_start(struct journal *j, u64 cur_seq, u64 last_seq = cur_seq, nr, seq; if (!list_empty(journal_entries)) - last_seq = le64_to_cpu(list_first_entry(journal_entries, - struct journal_replay, - list)->j.seq); + last_seq = le64_to_cpu(list_last_entry(journal_entries, + struct journal_replay, list)->j.last_seq); nr = cur_seq - last_seq; @@ -1017,8 +1016,10 @@ int bch2_fs_journal_start(struct journal *j, u64 cur_seq, list_for_each_entry(i, journal_entries, list) { seq = le64_to_cpu(i->j.seq); + BUG_ON(seq >= cur_seq); - BUG_ON(seq < last_seq || seq >= cur_seq); + if (seq < last_seq) + continue; journal_seq_pin(j, seq)->devs = i->devs; } |