mirror of
https://github.com/ceph/ceph
synced 2025-04-01 00:26:47 +00:00
osd: avoid map_lock for scrub_map reply
Using osd->osdmap->epoch without map_lock is dangerous. We can avoid it entirely by replying on the same connection as the request. Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
This commit is contained in:
parent
416292027d
commit
a948aa1180
@ -3121,17 +3121,12 @@ void PG::replica_scrub(MOSDRepScrub *msg)
|
||||
eversion_t v;
|
||||
osd_reqid_t reqid;
|
||||
MOSDSubOp *subop = new MOSDSubOp(reqid, info.pgid, poid, false, 0,
|
||||
osd->osdmap->get_epoch(), osd->get_tid(), v);
|
||||
msg->map_epoch, osd->get_tid(), v);
|
||||
::encode(map, subop->get_data());
|
||||
subop->ops = scrub;
|
||||
|
||||
unlock();
|
||||
osd->map_lock.get_read();
|
||||
lock();
|
||||
osd->cluster_messenger->send_message(subop, msg->get_connection());
|
||||
|
||||
osd->cluster_messenger->send_message(subop, osd->osdmap->get_cluster_inst(acting[0]));
|
||||
|
||||
osd->map_lock.put_read();
|
||||
msg->put();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user