From: Casey Bodley Date: Fri, 13 May 2016 17:01:38 +0000 (-0400) Subject: rgw: create thread_pipe before RGWHTTPManager::ReqsThread X-Git-Tag: v10.2.6~36^2~29^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b5a46108024a44221b15bb87fd61a06d9bdff6ce;p=ceph.git rgw: create thread_pipe before RGWHTTPManager::ReqsThread closes a potential race between pipe creation and RGWHTTPManager::reqs_thread_entry()'s access of thread_pipe Signed-off-by: Casey Bodley (cherry picked from commit 9161e9fdbfb2aa529a87197ef1a34f03917b80d9) --- diff --git a/src/rgw/rgw_http_client.cc b/src/rgw/rgw_http_client.cc index 283886a41ec1..2ebbb417c036 100644 --- a/src/rgw/rgw_http_client.cc +++ b/src/rgw/rgw_http_client.cc @@ -707,16 +707,16 @@ int RGWHTTPManager::complete_requests() int RGWHTTPManager::set_threaded() { - is_threaded = true; - reqs_thread = new ReqsThread(this); - reqs_thread->create("http_manager"); - int r = pipe(thread_pipe); if (r < 0) { r = -errno; ldout(cct, 0) << "ERROR: pipe() returned errno=" << r << dendl; return r; } + + is_threaded = true; + reqs_thread = new ReqsThread(this); + reqs_thread->create("http_manager"); return 0; }