summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/md/bcache/journal.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c
index bd6201bc2eb1..3f9e39c38739 100644
--- a/drivers/md/bcache/journal.c
+++ b/drivers/md/bcache/journal.c
@@ -1187,7 +1187,9 @@ static bool __journal_res_get(struct cache_set *c, struct journal_res *res,
*/
if (!c->journal.cur->data->u64s) {
BUG_ON(test_bit(JOURNAL_DIRTY,
- &c->journal.flags));
+ &c->journal.flags) &&
+ !test_bit(JOURNAL_NEED_WRITE,
+ &c->journal.flags));
journal_entry_no_room(c);
continue;