diff options
-rw-r--r-- | drivers/md/bcache/journal.c | 4 | ||||
-rw-r--r-- | drivers/md/bcache/journal_types.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c index 150661bed2a1..d37130c70396 100644 --- a/drivers/md/bcache/journal.c +++ b/drivers/md/bcache/journal.c @@ -1032,6 +1032,8 @@ static enum { journal_entry_u64s_reserve(j), block_bytes(c)) * c->sb.block_size; + BUG_ON(j->prev_buf_sectors > j->cur_buf_sectors); + atomic_dec_bug(&fifo_peek_back(&j->pin).count); __bch_journal_next_entry(j); spin_unlock(&j->lock); @@ -1168,6 +1170,8 @@ static int journal_entry_open(struct journal *j) if (sectors <= 0) return sectors; + j->cur_buf_sectors = sectors; + u64s = (sectors << 9) / sizeof(u64); /* Subtract the journal header */ diff --git a/drivers/md/bcache/journal_types.h b/drivers/md/bcache/journal_types.h index 630518d2e022..b40a2dfae25a 100644 --- a/drivers/md/bcache/journal_types.h +++ b/drivers/md/bcache/journal_types.h @@ -112,6 +112,7 @@ struct journal { union journal_res_state reservations; unsigned cur_entry_u64s; unsigned prev_buf_sectors; + unsigned cur_buf_sectors; /* * Two journal entries -- one is currently open for new entries, the |