From: Yan, Zheng Date: Wed, 26 Sep 2018 10:50:22 +0000 (+0800) Subject: msg: clear message middle when clearing encoded message buffer X-Git-Tag: v14.0.1~152^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F24289%2Fhead;p=ceph.git msg: clear message middle when clearing encoded message buffer Otherwise it may trigger ceph_assert(middle.length() == 0) in Message::encode() Signed-off-by: "Yan, Zheng" --- diff --git a/src/msg/async/Protocol.cc b/src/msg/async/Protocol.cc index bcddc6989e52b..9d3fa503fbbfe 100644 --- a/src/msg/async/Protocol.cc +++ b/src/msg/async/Protocol.cc @@ -239,7 +239,7 @@ void ProtocolV1::send_message(Message *m) { (can_write == WriteStatus::NOWRITE || connection->get_features() != f)) { // ensure the correctness of message encoding bl.clear(); - m->get_payload().clear(); + m->clear_payload(); ldout(cct, 5) << __func__ << " clear encoded buffer previous " << f << " != " << connection->get_features() << dendl; }