summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlava Pestov <sviatoslavpestov@gmail.com>2015-01-30 15:14:46 -0800
committerKent Overstreet <kent.overstreet@gmail.com>2017-01-18 20:26:54 -0900
commit05565e8d30be32d44083483c7f1cb2852856ea74 (patch)
tree95e5ea146d60c5468986db295dcb3ca3af1afafc
parentb64843a70a96d2a83a193c56936483707541a15e (diff)
bcache: fix erroneous BUG_ON in journal.c
It is fine for there to be a dirty journal entry with no keys, as long as JOURNAL_NEED_WRITE is also set, meaning the journal write is about to go down. This happens when bch_journal_meta() is called for example. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-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;