bcachefs: Fix a "no journal entries found" bug
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 2 Dec 2022 16:45:58 +0000 (11:45 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:47 +0000 (17:09 -0400)
commitb9004e8576b1c2803ee7d7b3f28fbcc779f05ffb
tree8394c713cb4f33131cd233eced2b23cf213ea1a7
parente0de429a3ab5f9485ca781d6d4d7368a2e12d835
bcachefs: Fix a "no journal entries found" bug

On startup, we need to ensure the first journal entry written is a flush
write: after a clean shutdown we generally don't read the journal, which
means we might be overwriting whatever was there previously, and there
must always be at least one flush entry in the journal or recovery will
fail.

Found by fstests generic/388.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/journal_io.c
fs/bcachefs/journal_types.h
fs/bcachefs/super.c