]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
seastore/.../staged_fltree/node: check for conflict in Node::load 42020/head
authorSamuel Just <sjust@redhat.com>
Thu, 24 Jun 2021 23:25:54 +0000 (16:25 -0700)
committerSamuel Just <sjust@redhat.com>
Thu, 24 Jun 2021 23:30:15 +0000 (16:30 -0700)
This will be unnecessary once converted to interruptible_future.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/onode_manager/staged-fltree/node.cc

index 9fab9a8caa0e8767db937dd9f72a3fbdc76ff9b3..3403ca016759a49e9c74ed42611e633b554f2246 100644 (file)
@@ -684,7 +684,12 @@ eagain_future<Ref<Node>> Node::load(
              c.t, addr, expect_is_level_tail);
       ceph_abort("fatal error");
     })
-  ).safe_then([FNAME, c, addr, expect_is_level_tail](auto extent) {
+  ).safe_then([FNAME, c, addr, expect_is_level_tail](auto extent)
+             -> eagain_future<Ref<Node>> {
+    if (c.t.is_conflicted()) {
+      return crimson::ct_error::eagain::make();
+    }
+    assert(extent->is_valid());
     auto header = extent->get_header();
     auto field_type = header.get_field_type();
     if (!field_type) {
@@ -709,7 +714,8 @@ eagain_future<Ref<Node>> Node::load(
         ceph_abort("fatal error");
       }
       auto impl = LeafNodeImpl::load(extent, *field_type);
-      return Ref<Node>(new LeafNode(impl.get(), std::move(impl)));
+      return eagain_ertr::make_ready_future<Ref<Node>>(
+       new LeafNode(impl.get(), std::move(impl)));
     } else if (node_type == node_type_t::INTERNAL) {
       if (extent->get_length() != c.vb.get_internal_node_size()) {
         ERRORT("load addr={:x}, is_level_tail={} error, "
@@ -718,7 +724,8 @@ eagain_future<Ref<Node>> Node::load(
         ceph_abort("fatal error");
       }
       auto impl = InternalNodeImpl::load(extent, *field_type);
-      return Ref<Node>(new InternalNode(impl.get(), std::move(impl)));
+      return eagain_ertr::make_ready_future<Ref<Node>>(
+       new InternalNode(impl.get(), std::move(impl)));
     } else {
       ceph_abort("impossible path");
     }