From: Samuel Just Date: Thu, 14 Oct 2021 21:51:38 +0000 (-0700) Subject: crimson/os/seastore/segment_manager/block: open with dsync X-Git-Tag: v17.1.0~679^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F43554%2Fhead;p=ceph.git crimson/os/seastore/segment_manager/block: open with dsync 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 --- diff --git a/src/crimson/os/seastore/segment_manager/block.cc b/src/crimson/os/seastore/segment_manager/block.cc index 5b395fac589..907b0898976 100644 --- a/src/crimson/os/seastore/segment_manager/block.cc +++ b/src/crimson/os/seastore/segment_manager/block.cc @@ -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;