diff options
-rw-r--r-- | drivers/md/bcache/journal.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c index 1b68796154fb..55850be5c13c 100644 --- a/drivers/md/bcache/journal.c +++ b/drivers/md/bcache/journal.c @@ -1069,6 +1069,8 @@ static enum { atomic_dec_bug(&fifo_peek_back(&j->pin).count); __bch_journal_next_entry(j); + + cancel_delayed_work(&j->write_work); spin_unlock(&j->lock); /* ugh - might be called from __journal_res_get() under wait_event() */ @@ -1246,10 +1248,9 @@ static int journal_entry_open(struct journal *j) j->res_get_blocked_start = 0; } - if (!old.prev_buf_unwritten) - mod_delayed_work(system_freezable_wq, - &j->write_work, - msecs_to_jiffies(j->write_delay_ms)); + mod_delayed_work(system_freezable_wq, + &j->write_work, + msecs_to_jiffies(j->write_delay_ms)); } return ret; @@ -1870,11 +1871,6 @@ static void journal_write_done(struct closure *cl) closure_wake_up(&w->wait); wake_up(&j->wait); - if (journal_entry_is_open(j)) - mod_delayed_work(system_freezable_wq, &j->write_work, - test_bit(JOURNAL_NEED_WRITE, &j->flags) - ? 0 : msecs_to_jiffies(j->write_delay_ms)); - /* * Updating last_seq_ondisk may let journal_reclaim_work() discard more * buckets: |