mirror of
https://github.com/ceph/ceph
synced 2024-12-23 20:03:56 +00:00
rgw: civetweb_callback() refer to store inside lock
pe->store might change when reconfiguring Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
This commit is contained in:
parent
98433e589f
commit
2ca38dab07
@ -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<RGWMongooseEnv *>(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 */
|
||||
|
Loading…
Reference in New Issue
Block a user