aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-11-03 11:55:44 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-11-04 22:19:13 -0400
commit5a53f851e6fe0e7cc41e682a4a9e40bb178fb80b (patch)
tree3ce3a9377c48989276eb90689ca77fba9697c281 /fs
parentce3e9a8a10086b28444cab1431dfc926787ecfcb (diff)
downloadlinux-5a53f851e6fe0e7cc41e682a4a9e40bb178fb80b.tar.gz
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/bcachefs/recovery.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index 9600b808317534..9c30500ce9200a 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -735,6 +735,13 @@ int bch2_fs_recovery(struct bch_fs *c)
if (*i) {
last_journal_entry = &(*i)->j;
(*i)->ignore = false;
+ /*
+ * This was probably a NO_FLUSH entry,
+ * so last_seq was garbage - but we know
+ * we're only using a single journal
+ * entry, set it here:
+ */
+ (*i)->j.last_seq = (*i)->j.seq;
break;
}
}