rgw: fix segfault in OpsLogRados::log when realm is reloaded

We weren't previously handling the deallocation of the store when
a realm was reloaded. Now passing a const reference to the pointer.

Fixes: https://tracker.ceph.com/issues/54130
Signed-off-by: Cory Snyder <csnyder@iland.com>
This commit is contained in:
Cory Snyder 2022-02-03 14:48:05 -05:00
parent 75c4960abf
commit 0713f65355
2 changed files with 5 additions and 3 deletions

View File

@ -472,7 +472,7 @@ int OpsLogSocket::log_json(struct req_state* s, bufferlist& bl)
return 0;
}
OpsLogRados::OpsLogRados(rgw::sal::Store* store): store(store)
OpsLogRados::OpsLogRados(rgw::sal::Store* const& store): store(store)
{
}

View File

@ -199,9 +199,11 @@ public:
};
class OpsLogRados : public OpsLogSink {
rgw::sal::Store* store;
// main()'s Store pointer as a reference, possibly modified by RGWRealmReloader
rgw::sal::Store* const& store;
public:
OpsLogRados(rgw::sal::Store* store);
OpsLogRados(rgw::sal::Store* const& store);
int log(struct req_state* s, struct rgw_log_entry& entry) override;
};