summaryrefslogtreecommitdiff
path: root/fs/bcachefs/journal_io.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-02-19 13:41:36 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:17 -0400
commit68ef94a63caf214ee238434bf0d4c7a6a32c33a2 (patch)
tree903e1c65cc599f98f6417e0ca845247b850b9148 /fs/bcachefs/journal_io.c
parent9ace606e93e9c6dff919ca8f35d461e8462590b7 (diff)
downloadlwn-68ef94a63caf214ee238434bf0d4c7a6a32c33a2.tar.gz
lwn-68ef94a63caf214ee238434bf0d4c7a6a32c33a2.zip
bcachefs: Add a pre-reserve mechanism for the journal
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal_io.c')
-rw-r--r--fs/bcachefs/journal_io.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c
index 07cfbb975c37..db95257cec11 100644
--- a/fs/bcachefs/journal_io.c
+++ b/fs/bcachefs/journal_io.c
@@ -974,6 +974,12 @@ static int journal_write_alloc(struct journal *j, struct journal_buf *w,
journal_space_discarded)) {
ja->cur_idx = (ja->cur_idx + 1) % ja->nr;
ja->sectors_free = ca->mi.bucket_size;
+
+ /*
+ * ja->bucket_seq[ja->cur_idx] must always have
+ * something sensible:
+ */
+ ja->bucket_seq[ja->cur_idx] = le64_to_cpu(w->data->seq);
}
}