]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: hold cr reference in MetadataListCR callback
authorCasey Bodley <cbodley@redhat.com>
Tue, 24 Oct 2017 16:23:41 +0000 (12:23 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 10 Nov 2017 18:23:03 +0000 (13:23 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_sync_log_trim.cc

index d6744ca4a4b9bf7e0fb011736cb91f3b0121bae5..80d8f2205f74d57921955f42259e15bf077cd5d1 100644 (file)
@@ -797,8 +797,10 @@ int BucketTrimCR::operate()
 
       set_status("listing cold buckets for trim");
       yield {
+        // capture a reference so 'this' remains valid in the callback
+        auto ref = boost::intrusive_ptr<RGWCoroutine>{this};
         // list cold buckets to consider for trim
-        auto cb = [this] (std::string&& bucket, std::string&& marker) {
+        auto cb = [this, ref] (std::string&& bucket, std::string&& marker) {
           // filter out keys that we trimmed recently
           if (observer->trimmed_recently(bucket)) {
             return true;