From: Yehuda Sadeh Date: Thu, 14 Jan 2016 00:40:22 +0000 (-0800) Subject: rgw: hold reference to req_completion while calling aio_operate() X-Git-Tag: v10.1.0~354^2~53 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fd46b2d92ae0d3e09e23ab022f08c8e2eb33251d;p=ceph.git rgw: hold reference to req_completion while calling aio_operate() 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 --- diff --git a/src/rgw/rgw_metadata.cc b/src/rgw/rgw_metadata.cc index 9e263e4dbc08..97a5a5ce0e2c 100644 --- a/src/rgw/rgw_metadata.cc +++ b/src/rgw/rgw_metadata.cc @@ -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; }