]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: silence coverity warning in async read operation contexts 16617/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 27 Jul 2017 19:17:32 +0000 (15:17 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 27 Jul 2017 19:18:24 +0000 (15:18 -0400)
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 <dillaman@redhat.com>
src/osd/PrimaryLogPG.cc

index e07b074351d97b906f72db4e732930358acbf4ca..6a333674af47481c9b85bdb8c0db1753d6f970eb 100644 (file)
@@ -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);