mirror of
https://github.com/ceph/ceph
synced 2025-02-22 18:47:18 +00:00
msg/Pipe: encode message inside pipe_lock
This modifies bufferlists in the Message struct, and it is possible for multiple instances of the Pipe to get references on the Message; make sure they don't modify those bufferlists concurrently. Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
a058f16113
commit
4cfc4903c6
@ -1470,13 +1470,13 @@ void Pipe::writer()
|
||||
// associate message with Connection (for benefit of encode_payload)
|
||||
m->set_connection(connection_state->get());
|
||||
|
||||
pipe_lock.Unlock();
|
||||
|
||||
ldout(msgr->cct,20) << "writer encoding " << m->get_seq() << " " << m << " " << *m << dendl;
|
||||
|
||||
// encode and copy out of *m
|
||||
m->encode(connection_state->get_features(), !msgr->cct->_conf->ms_nocrc);
|
||||
|
||||
pipe_lock.Unlock();
|
||||
|
||||
ldout(msgr->cct,20) << "writer sending " << m->get_seq() << " " << m << dendl;
|
||||
int rc = write_message(m);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user