From: Kent Overstreet Date: Fri, 8 Mar 2019 04:14:35 +0000 (-0500) Subject: bcachefs: fix a faulty assertion X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=db6447b383e5299e864826a3adc29b5eca04f4c5;p=linux.git bcachefs: fix a faulty assertion Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c index 0aae8fd74c8a5..64f9c5740ec8e 100644 --- a/fs/bcachefs/journal.c +++ b/fs/bcachefs/journal.c @@ -248,13 +248,13 @@ static int journal_entry_open(struct journal *j) do { old.v = new.v = v; - EBUG_ON(journal_state_count(new, new.idx)); - if (old.cur_entry_offset == JOURNAL_ENTRY_ERROR_VAL) return -EROFS; /* Handle any already added entries */ new.cur_entry_offset = le32_to_cpu(buf->data->u64s); + + EBUG_ON(journal_state_count(new, new.idx)); journal_state_inc(&new); } while ((v = atomic64_cmpxchg(&j->reservations.counter, old.v, new.v)) != old.v);