]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix reference leak
authormyoungwon oh <ohmyoungwon@gmail.com>
Wed, 8 Jul 2020 06:15:31 +0000 (15:15 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Wed, 8 Jul 2020 06:15:31 +0000 (15:15 +0900)
ctx will be moved, so replace it with the value

Signed-off-by: Myoungwon Oh <ohmyoungwon@gmail.com>
src/osd/PrimaryLogPG.cc

index 58f3ca3fe1affb5c2b234463849eae471b32250f..92ce9516d608d0b70660dbb409af864b0c67d592 100644 (file)
@@ -3515,9 +3515,12 @@ void PrimaryLogPG::dec_all_refcount_manifest(const object_info_t& oi, OpContext*
       refs);
 
     if (!refs.is_empty()) {
+      hobject_t soid = ctx->obc->obs.oi.soid;
       ctx->register_on_commit(
-       [ctx, this, refs](){
-         dec_refcount(ctx->obc, refs);
+       [soid, this, refs](){
+         ObjectContextRef obc = get_object_context(soid, false, NULL);
+         ceph_assert(obc);
+         dec_refcount(obc, refs);
        });
     }
   } else if (oi.manifest.is_redirect()) {