summaryrefslogtreecommitdiff
path: root/fs/bcachefs/journal_types.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-12-02 19:45:58 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:47 +0300
commitb9004e8576b1c2803ee7d7b3f28fbcc779f05ffb (patch)
tree8394c713cb4f33131cd233eced2b23cf213ea1a7 /fs/bcachefs/journal_types.h
parente0de429a3ab5f9485ca781d6d4d7368a2e12d835 (diff)
downloadlinux-b9004e8576b1c2803ee7d7b3f28fbcc779f05ffb.tar.xz
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>
Diffstat (limited to 'fs/bcachefs/journal_types.h')
-rw-r--r--fs/bcachefs/journal_types.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/journal_types.h b/fs/bcachefs/journal_types.h
index a41b915b3ac6..4c3065dceeea 100644
--- a/fs/bcachefs/journal_types.h
+++ b/fs/bcachefs/journal_types.h
@@ -141,10 +141,11 @@ enum journal_space_from {
journal_space_nr,
};
-enum {
+enum journal_flags {
JOURNAL_REPLAY_DONE,
JOURNAL_STARTED,
JOURNAL_MAY_SKIP_FLUSH,
+ JOURNAL_NEED_FLUSH_WRITE,
};
#define JOURNAL_WATERMARKS() \