Skip to content

Commit 5a53f85

Browse files
author
Kent Overstreet
committed
bcachefs: Fix recovery when forced to use JSET_NO_FLUSH journal entry
When we didn't find anything in the journal that we'd like to use, and we're forced to use whatever we can find - that entry will have been a JSET_NO_FLUSH entry with a garbage last_seq value, since it's not normally used. Initialize it to something sane, for bch2_fs_journal_start(). Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent ce3e9a8 commit 5a53f85

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

fs/bcachefs/recovery.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,13 @@ int bch2_fs_recovery(struct bch_fs *c)
735735
if (*i) {
736736
last_journal_entry = &(*i)->j;
737737
(*i)->ignore = false;
738+
/*
739+
* This was probably a NO_FLUSH entry,
740+
* so last_seq was garbage - but we know
741+
* we're only using a single journal
742+
* entry, set it here:
743+
*/
744+
(*i)->j.last_seq = (*i)->j.seq;
738745
break;
739746
}
740747
}

0 commit comments

Comments
 (0)