From: myoungwon oh Date: Wed, 8 Jul 2020 06:15:31 +0000 (+0900) Subject: osd: fix reference leak X-Git-Tag: v16.1.0~1738^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=65c99a4f3efd197e3ce8e91605903609b01ab0d2;p=ceph.git osd: fix reference leak ctx will be moved, so replace it with the value Signed-off-by: Myoungwon Oh --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 58f3ca3fe1af..92ce9516d608 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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()) {