From d61094f45ec027f0f57ecd8f017bae4ec70fa33e Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Thu, 27 Jul 2017 15:17:32 -0400 Subject: [PATCH] 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 --- src/osd/PrimaryLogPG.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index e07b074351d97..6a333674af474 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); -- 2.47.3