summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-03-20 20:12:53 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2022-04-02 16:02:55 -0400
commit5a52c520c5a793b49aa3901136f12d062c5536ce (patch)
treedfbc0ecd669a5267303cc791c890f94926560dcb
parent2cfae96e5dc798995e0847d0641c0ebf2cc5382a (diff)
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: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/journal_io.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c
index fca9bc47b889..e61b88930a7f 100644
--- a/fs/bcachefs/journal_io.c
+++ b/fs/bcachefs/journal_io.c
@@ -966,8 +966,16 @@ static void bch2_journal_read_device(struct closure *cl)
}
mutex_unlock(&jlist->lock);
- BUG_ON(ja->bucket_seq[ja->cur_idx] &&
- ja->sectors_free == ca->mi.bucket_size);
+ if (ja->bucket_seq[ja->cur_idx] &&
+ 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 - 1 + i;
+ 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