From: Sage Weil Date: Thu, 16 Mar 2017 15:30:37 +0000 (-0400) Subject: os/bluestore: flush_cache on umount, fsck finish, etc. X-Git-Tag: v12.0.1~12^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e83fc554912b3478352866f8537d021bde1fa15d;p=ceph.git os/bluestore: flush_cache on umount, fsck finish, etc. Otherwise cache items survive beyond umount into the next mount cycle! Also, ensure that we flush_cache *before* clearing coll_map, as some cache items have references back to the Collection. Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 77558f017e227..bf435cf97fd60 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -4762,6 +4762,7 @@ int BlueStore::mount() f->stop(); } out_coll: + flush_cache(); coll_map.clear(); out_alloc: _close_alloc(); @@ -4798,6 +4799,7 @@ int BlueStore::umount() f->stop(); } _reap_collections(); + flush_cache(); coll_map.clear(); dout(20) << __func__ << " closing" << dendl; @@ -4960,6 +4962,7 @@ int BlueStore::fsck(bool deep) } r = bluefs->fsck(); if (r < 0) { + flush_cache(); coll_map.clear(); goto out_alloc; } @@ -5341,6 +5344,7 @@ int BlueStore::fsck(bool deep) } out_scan: + flush_cache(); coll_map.clear(); out_alloc: _close_alloc(); @@ -10250,6 +10254,7 @@ void BlueStore::generate_db_histogram(Formatter *f) void BlueStore::flush_cache() { + dout(10) << __func__ << dendl; for (auto i : cache_shards) { i->trim_all(); }