diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2016-03-22 05:00:31 -0800 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2017-01-18 21:38:44 -0900 |
commit | 0a14ff9c0efca334b0b1f5e057cbe01126e40850 (patch) | |
tree | e9b44a0c5709553e42baaab91130ecb96751fcc4 | |
parent | 3205df3b5e8235f05370e859275cabb3c5f2822a (diff) |
bcache: Make sure to do a journal write after flushing btree
-rw-r--r-- | drivers/md/bcache/super.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 6d99cfe80df4..95fdc442f663 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -717,11 +717,16 @@ static void __bch_cache_set_read_only(struct cache_set *c) bch_btree_flush(c); + /* + * Write a journal entry after flushing the btree, so we don't end up + * replaying everything we just flushed: + */ + if (test_bit(CACHE_SET_INITIAL_GC_DONE, &c->flags)) + bch_journal_meta(&c->journal); + for_each_cache(ca, c, i) bch_cache_allocator_stop(ca); - bch_journal_flush(&c->journal); - cancel_delayed_work_sync(&c->journal.write_work); } |