mirror of
https://github.com/ceph/ceph
synced 2025-03-25 11:48:05 +00:00
OSDMap: fix damaging input osdmap from remove_down_temps
The default copy constructor copies shared_ptrs do vectors that are then modified by apply_incremental, which means that the const osdmap argument isn't in fact const. Fix this by doing a deep(ish) copy. Fixes: #7060 Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
bd54b9841b
commit
368852f6c0
@ -1073,7 +1073,8 @@ void OSDMap::remove_down_temps(CephContext *cct,
|
||||
const OSDMap& osdmap, Incremental *pending_inc)
|
||||
{
|
||||
ldout(cct, 10) << "remove_down_pg_temp" << dendl;
|
||||
OSDMap tmpmap(osdmap);
|
||||
OSDMap tmpmap;
|
||||
tmpmap.deepish_copy_from(osdmap);
|
||||
tmpmap.apply_incremental(*pending_inc);
|
||||
|
||||
for (map<pg_t,vector<int> >::iterator p = tmpmap.pg_temp->begin();
|
||||
|
Loading…
Reference in New Issue
Block a user