From 703545c59540b19752f079e8519c20a91b117e08 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 29 May 2021 16:24:59 +0800 Subject: [PATCH] crimson/os/alienstore: do not cleanup if not started there is chance stop() and umount() methods get called even if start() is not called in the error handling path. in that case, just make these methods no-op. to ensure that OSD behaves in that case. Signed-off-by: Kefu Chai --- src/crimson/os/alienstore/alien_store.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/crimson/os/alienstore/alien_store.cc b/src/crimson/os/alienstore/alien_store.cc index c2e9f1a669dc7..c8f9506842f83 100644 --- a/src/crimson/os/alienstore/alien_store.cc +++ b/src/crimson/os/alienstore/alien_store.cc @@ -95,7 +95,10 @@ seastar::future<> AlienStore::start() seastar::future<> AlienStore::stop() { - assert(tp); + if (!tp) { + // not really started yet + return seastar::now(); + } return tp->submit([this] { for (auto [cid, ch]: coll_map) { static_cast(ch.get())->collection.reset(); @@ -123,7 +126,10 @@ seastar::future<> AlienStore::mount() seastar::future<> AlienStore::umount() { logger().info("{}", __func__); - assert(tp); + if (!tp) { + // not really started yet + return seastar::now(); + } return transaction_gate.close().then([this] { return tp->submit([this] { return store->umount(); -- 2.39.5