summaryrefslogtreecommitdiff
path: root/fs/bcachefs/journal.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-05-07 23:32:26 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:02 -0400
commit1784d43a88ecf0da66514f4b7f0f52b4182ef81c (patch)
treebe21ccd70b36a4f3c361f9a143879c2057849ee0 /fs/bcachefs/journal.c
parentac1019d32b31c8bca6e0e5f86b403e91a1da5786 (diff)
bcachefs: Fix usage of last_seq + encryption
jset->last_seq is in the region that's encrypted - on journal write completion, we were using it and getting garbage. This patch shadows it to fix. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal.c')
-rw-r--r--fs/bcachefs/journal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c
index a70540853586..a7cc0b167072 100644
--- a/fs/bcachefs/journal.c
+++ b/fs/bcachefs/journal.c
@@ -189,7 +189,8 @@ static bool __journal_entry_close(struct journal *j)
* Hence, we want update/set last_seq on the current journal entry right
* before we open a new one:
*/
- buf->data->last_seq = cpu_to_le64(journal_last_seq(j));
+ buf->last_seq = journal_last_seq(j);
+ buf->data->last_seq = cpu_to_le64(buf->last_seq);
__bch2_journal_pin_put(j, le64_to_cpu(buf->data->seq));