Commit b0be2fcf authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Change journal_io.c assertion to error message

Something funny is going on with the new code for restoring the journal
write point, and it's hard to reproduce.

We do want to debug this because resuming writing to the journal in the
wrong spot could be something serious. For now, replace the assertion
with an error message and revert to old behaviour when it happens.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 7a6f4411
...@@ -964,8 +964,16 @@ static void bch2_journal_read_device(struct closure *cl) ...@@ -964,8 +964,16 @@ static void bch2_journal_read_device(struct closure *cl)
} }
mutex_unlock(&jlist->lock); mutex_unlock(&jlist->lock);
BUG_ON(ja->bucket_seq[ja->cur_idx] && if (ja->bucket_seq[ja->cur_idx] &&
ja->sectors_free == ca->mi.bucket_size); ja->sectors_free == ca->mi.bucket_size) {
bch_err(c, "ja->sectors_free == ca->mi.bucket_size");
bch_err(c, "cur_idx %u/%u", ja->cur_idx, ja->nr);
for (i = 0; i < 3; i++) {
unsigned idx = (ja->cur_idx + ja->nr - 1 + i) % ja->nr;
bch_err(c, "bucket_seq[%u] = %llu", idx, ja->bucket_seq[idx]);
}
ja->sectors_free = 0;
}
/* /*
* Set dirty_idx to indicate the entire journal is full and needs to be * Set dirty_idx to indicate the entire journal is full and needs to be
......
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