From: Yehuda Sadeh Date: Tue, 3 May 2016 18:59:11 +0000 (-0700) Subject: rgw: civetweb_callback() refer to store inside lock X-Git-Tag: v10.2.1~39^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2d0cd8a08bb26f519d2b9b59bfe54f014cc36a1f;p=ceph.git rgw: civetweb_callback() refer to store inside lock pe->store might change when reconfiguring Signed-off-by: Yehuda Sadeh (cherry picked from commit 2ca38dab071c7d20a224a4e1dacfd68548fe52dd) --- diff --git a/src/rgw/rgw_civetweb_frontend.cc b/src/rgw/rgw_civetweb_frontend.cc index 557bb5b0f3e9..e3df80c619a0 100644 --- a/src/rgw/rgw_civetweb_frontend.cc +++ b/src/rgw/rgw_civetweb_frontend.cc @@ -8,17 +8,18 @@ static int civetweb_callback(struct mg_connection* conn) { struct mg_request_info* req_info = mg_get_request_info(conn); RGWMongooseEnv* pe = static_cast(req_info->user_data); - RGWRados* store = pe->store; - RGWREST* rest = pe->rest; - OpsLogSocket* olog = pe->olog; - - RGWRequest req(store->get_new_req_id()); - RGWMongoose client_io(conn, pe->port); { // hold a read lock over access to pe->store for reconfiguration RWLock::RLocker lock(pe->mutex); + RGWRados* store = pe->store; + RGWREST* rest = pe->rest; + OpsLogSocket* olog = pe->olog; + + RGWRequest req(store->get_new_req_id()); + RGWMongoose client_io(conn, pe->port); + int ret = process_request(pe->store, rest, &req, &client_io, olog); if (ret < 0) { /* we don't really care about return code */