Commit ef0beeb8 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: move journal seq assertion

journal_cur_seq() can legitimately be used outside of the journal lock,
where this assert can race
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 1b1bd0fd
...@@ -321,6 +321,8 @@ static int journal_entry_open(struct journal *j) ...@@ -321,6 +321,8 @@ static int journal_entry_open(struct journal *j)
atomic64_inc(&j->seq); atomic64_inc(&j->seq);
journal_pin_list_init(fifo_push_ref(&j->pin), 1); journal_pin_list_init(fifo_push_ref(&j->pin), 1);
BUG_ON(j->pin.back - 1 != atomic64_read(&j->seq));
BUG_ON(j->buf + (journal_cur_seq(j) & JOURNAL_BUF_MASK) != buf); BUG_ON(j->buf + (journal_cur_seq(j) & JOURNAL_BUF_MASK) != buf);
bkey_extent_init(&buf->key); bkey_extent_init(&buf->key);
......
...@@ -136,9 +136,7 @@ static inline u64 journal_last_seq(struct journal *j) ...@@ -136,9 +136,7 @@ static inline u64 journal_last_seq(struct journal *j)
static inline u64 journal_cur_seq(struct journal *j) static inline u64 journal_cur_seq(struct journal *j)
{ {
EBUG_ON(j->pin.back - 1 != atomic64_read(&j->seq)); return atomic64_read(&j->seq);
return j->pin.back - 1;
} }
static inline u64 journal_last_unwritten_seq(struct journal *j) static inline u64 journal_last_unwritten_seq(struct journal *j)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment