]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix Extent leak from _wctx_finish
authorSage Weil <sage@redhat.com>
Tue, 13 Sep 2016 17:41:43 +0000 (13:41 -0400)
committerSage Weil <sage@redhat.com>
Wed, 14 Sep 2016 14:10:38 +0000 (10:10 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index deff326208804638dd8c053807263cb45bf7cc45..a981d7277e42b38b1ddf0d8af7b8506de603945d 100644 (file)
@@ -7353,7 +7353,10 @@ void BlueStore::_wctx_finish(
   WriteContext *wctx)
 {
   set<pair<bool, BlobRef> > blobs2remove;
-  for (auto &lo : wctx->old_extents) {
+  auto oep = wctx->old_extents.begin();
+  while (oep != wctx->old_extents.end()) {
+    auto &lo = *oep;
+    oep = wctx->old_extents.erase(oep);
     dout(20) << __func__ << " lex_old " << lo << dendl;
     BlobRef b = lo.blob;
     const bluestore_blob_t& blob = b->get_blob();
@@ -7401,6 +7404,7 @@ void BlueStore::_wctx_finish(
         txc->statfs_delta.compressed_allocated() -= e.length;
       }
     }
+    delete &lo;
   }
 }