From: Jason Dillaman Date: Thu, 27 Jul 2017 19:17:32 +0000 (-0400) Subject: osd: silence coverity warning in async read operation contexts X-Git-Tag: v12.1.2~37^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d61094f45ec027f0f57ecd8f017bae4ec70fa33e;p=ceph.git osd: silence coverity warning in async read operation contexts Coverity doesn't know that the context is deleted via the "complete" method and the embedded context is therefore also destructed when it's completed. Signed-off-by: Jason Dillaman --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index e07b074351d9..6a333674af47 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -4491,9 +4491,13 @@ struct C_ChecksumRead : public Context { &read_bl, maybe_crc, size, osd, soid, flags)) { } + ~C_ChecksumRead() override { + delete fill_extent_ctx; + } void finish(int r) override { fill_extent_ctx->complete(r); + fill_extent_ctx = nullptr; if (osd_op.rval >= 0) { bufferlist::iterator init_value_bl_it = init_value_bl.begin(); @@ -4685,9 +4689,13 @@ struct C_ExtentCmpRead : public Context { &read_bl, maybe_crc, size, osd, soid, flags)) { } + ~C_ExtentCmpRead() override { + delete fill_extent_ctx; + } void finish(int r) override { fill_extent_ctx->complete(r); + fill_extent_ctx = nullptr; if (osd_op.rval >= 0) { osd_op.rval = primary_log_pg->finish_extent_cmp(osd_op, read_bl);