ceph-kvstore-tool use start_kv_only to debug the kvstore. we
will get a crash when we try to umount bluestore in kvstore-tool.
Fixes: http://tracker.ceph.com/issues/21624
Signed-off-by: Chang Liu <liuchang0812@gmail.com>
{
dout(1) << __func__ << " path " << path << dendl;
+ _kv_only = kv_only;
+
{
string type;
int r = read_meta("type", &type);
int BlueStore::umount()
{
- assert(mounted);
+ assert(_kv_only || mounted);
dout(1) << __func__ << dendl;
_osr_drain_all();
_osr_unregister_all();
- mempool_thread.shutdown();
-
- dout(20) << __func__ << " stopping kv thread" << dendl;
- _kv_stop();
- _reap_collections();
- _flush_cache();
- dout(20) << __func__ << " closing" << dendl;
-
mounted = false;
- _close_alloc();
- _close_fm();
+ if (!_kv_only) {
+ mempool_thread.shutdown();
+ dout(20) << __func__ << " stopping kv thread" << dendl;
+ _kv_stop();
+ _reap_collections();
+ _flush_cache();
+ dout(20) << __func__ << " closing" << dendl;
+
+ _close_alloc();
+ _close_fm();
+ }
_close_db();
_close_bdev();
_close_fsid();
KVSyncThread kv_sync_thread;
std::mutex kv_lock;
std::condition_variable kv_cond;
+ bool _kv_only = false;
bool kv_sync_started = false;
bool kv_stop = false;
bool kv_finalize_started = false;