]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/cache: extend extent lifecycle after wait-io 64401/head
authorYingxin Cheng <yingxin.cheng@intel.com>
Wed, 9 Jul 2025 06:26:23 +0000 (14:26 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Wed, 9 Jul 2025 06:34:44 +0000 (14:34 +0800)
See the captured backtrace, it happens during transaction conflict,
which mean no one else might be helding the extent reference in this
case.

Extend the lifecycle to try to fix the issue.

Fixes: https://tracker.ceph.com/issues/72017
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/cache.h

index 8aee25532875de04aa84d8c1e1940a462b640a13..dc7e25bcf6d7149a7e1e2202c1e5df076644a56c 100644 (file)
@@ -509,15 +509,16 @@ public:
       // always try step 2 if paddr unknown
       needs_step_2 = !ret.is_paddr_known;
 
+      auto target_extent = CachedExtentRef(&extent);
       return trans_intr::make_interruptible(
        extent.wait_io()
-      ).then_interruptible([&extent, needs_touch,
+      ).then_interruptible([target_extent, needs_touch,
                            needs_step_2, &t, this, t_src] {
        if (needs_step_2) {
-         t.maybe_add_to_read_set_step_2(&extent);
+         t.maybe_add_to_read_set_step_2(target_extent.get());
        }
        if (needs_touch) {
-         touch_extent(extent, &t_src, t.get_cache_hint());
+         touch_extent(*target_extent, &t_src, t.get_cache_hint());
        }
        return get_extent_iertr::now();
       });
@@ -624,9 +625,11 @@ public:
     assert(is_logical_type(p_extent->get_type()) ||
            p_extent->is_fully_loaded());
 
+    auto target_extent = CachedExtentRef(p_extent);
     return trans_intr::make_interruptible(
       p_extent->wait_io()
-    ).then_interruptible([p_extent, needs_touch, needs_step_2, &t, this, t_src] {
+    ).then_interruptible([target_extent, needs_touch, needs_step_2, &t, this, t_src] {
+      auto p_extent = target_extent.get();
       if (needs_step_2) {
        t.maybe_add_to_read_set_step_2(p_extent);
       }