]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/cache: add newly read extent prior to read
authorSamuel Just <sjust@redhat.com>
Mon, 11 Jan 2021 23:00:58 +0000 (15:00 -0800)
committerSamuel Just <sjust@redhat.com>
Tue, 19 Jan 2021 20:55:43 +0000 (20:55 +0000)
We already block access to it, but it needs to be in the cache
for a concurrent transaction to see it and block appropriately.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/cache.h

index 6242721628453c8ddf001bf0854f40423a9dda04..28d5f43aaf18d3fce6cb199432f2a09bb2202827 100644 (file)
@@ -156,6 +156,7 @@ public:
       ref->set_io_wait();
       ref->set_paddr(offset);
       ref->state = CachedExtent::extent_state_t::CLEAN;
+      add_extent(ref);
 
       return segment_manager.read(
        offset,
@@ -167,7 +168,6 @@ public:
 
            ref->on_clean_read();
            ref->complete_io();
-           add_extent(ref);
            return get_extent_ertr::make_ready_future<TCachedExtentRef<T>>(
              std::move(ref));
          },