]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/alienstore: do not cleanup if not started 41589/head
authorKefu Chai <kchai@redhat.com>
Sat, 29 May 2021 08:24:59 +0000 (16:24 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 31 May 2021 12:06:40 +0000 (20:06 +0800)
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 <kchai@redhat.com>
src/crimson/os/alienstore/alien_store.cc

index c2e9f1a669dc7505597650740941ea9e7d797e79..c8f9506842f833e67f30aee253d5f6abdb9530e9 100644 (file)
@@ -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<AlienCollection*>(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();