From b5a46108024a44221b15bb87fd61a06d9bdff6ce Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 13 May 2016 13:01:38 -0400 Subject: [PATCH] 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) --- src/rgw/rgw_http_client.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_http_client.cc b/src/rgw/rgw_http_client.cc index 283886a41ec19..2ebbb417c0365 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; } -- 2.39.5