]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os: return seastar::now() in "finally()" block
authorKefu Chai <kchai@redhat.com>
Wed, 16 Jun 2021 11:05:53 +0000 (19:05 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 16 Jun 2021 11:09:04 +0000 (19:09 +0800)
so finally() is able to identify the return is a future, and discard it
manually.
otherwise the return value will be discarded even the future is marked
[[nodiscard]], hence the C++ compiler warns.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/os/seastore/random_block_manager/nvme_manager.cc

index 90736746b1f702dfa619bedcb8f65f28f99fe996..989c7864b2f7b31b1cf4cf533a792e74d450a94d 100644 (file)
@@ -160,8 +160,9 @@ NVMeManager::mkfs_ertr::future<> NVMeManager::mkfs(mkfs_config_t config)
   }).finally([this] {
     if (device) {
       return device->close();
+    } else {
+      return seastar::now();
     }
-    return mkfs_ertr::now();
   });
 }