]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: hold reference to req_completion while calling aio_operate()
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 14 Jan 2016 00:40:22 +0000 (16:40 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:13:55 +0000 (16:13 -0800)
This is a workaround to fix issue with aio_operate() racing with the
request completion. This way we make sure completion->release() is
called after aio_operate() finishes.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_metadata.cc

index 9e263e4dbc08fc60683126bdd720495d8495e825..97a5a5ce0e2cfb26d9ddfb2f8a97beb243ece100 100644 (file)
@@ -240,11 +240,15 @@ int RGWMetadataLog::get_info_async(int shard_id, RGWMetadataLogInfo *info, RGWCo
 
   RGWMetadataLogInfoCompletion *req_completion = new RGWMetadataLogInfoCompletion(info, completion_manager, user_info, pret);
 
+  req_completion->get();
+
   int ret = store->time_log_info_async(req_completion->get_io_ctx(), oid, req_completion->get_header(), req_completion->get_completion());
   if (ret < 0) {
     return ret;
   }
 
+  req_completion->put();
+
   return 0;
 }