]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore/segment_manager/block: open with dsync
authorSamuel Just <sjust@redhat.com>
Thu, 14 Oct 2021 21:51:38 +0000 (14:51 -0700)
committerSamuel Just <sjust@redhat.com>
Thu, 14 Oct 2021 21:54:11 +0000 (14:54 -0700)
67efc4 appears to be simply incorrect, I don't see any calls
to flush(), so we do need to open with dsync until we
implement a smarter flushing scheme.

Also, refactor open_device to remove mode param -- we always
pass the same value.

Reverts: 67efc48332cebb69497c5676be6ed2a6e5365e03
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/segment_manager/block.cc

index 5b395fac589b63ef8263c43c81f2f1c96e0e8d3d..907b089897669897583a35f46d05cc5c7ded76f4 100644 (file)
@@ -245,12 +245,14 @@ using open_device_ret =
   >;
 static
 open_device_ret open_device(
-  const std::string &path,
-  seastar::open_flags mode)
+  const std::string &path)
 {
   return seastar::file_stat(path, seastar::follow_symlink::yes
-  ).then([mode, &path](auto stat) mutable {
-    return seastar::open_file_dma(path, mode).then([=](auto file) {
+  ).then([&path](auto stat) mutable {
+    return seastar::open_file_dma(
+      path,
+      seastar::open_flags::rw | seastar::open_flags::dsync
+    ).then([=](auto file) {
       logger().error(
        "open_device: open successful, size {}",
        stat.size
@@ -389,7 +391,7 @@ BlockSegmentManager::~BlockSegmentManager()
 BlockSegmentManager::mount_ret BlockSegmentManager::mount()
 {
   return open_device(
-    device_path, seastar::open_flags::rw
+    device_path
   ).safe_then([=](auto p) {
     device = std::move(p.first);
     auto sd = p.second;
@@ -440,7 +442,7 @@ BlockSegmentManager::mkfs_ret BlockSegmentManager::mkfs(
       }
 
       return maybe_create.safe_then([this] {
-       return open_device(device_path, seastar::open_flags::rw);
+       return open_device(device_path);
       }).safe_then([&, sm_config](auto p) {
        device = p.first;
        stat = p.second;