From: Jianpeng Ma Date: Thu, 26 Oct 2017 10:08:54 +0000 (+0800) Subject: msg/async: record correctly l_msgr_send_bytes if "rc == 0". X-Git-Tag: v13.0.1~412^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e5645183504616bde015c9a8836bad96e039a2c3;p=ceph.git msg/async: record correctly l_msgr_send_bytes if "rc == 0". If rc == 0, it mean all data of outcoming_bl whether old or new data. Signed-off-by: Jianpeng Ma --- diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index 37b77807e77..ea8a2c7131b 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -2184,8 +2184,6 @@ ssize_t AsyncConnection::write_message(Message *m, bufferlist& bl, bool more) } } - unsigned original_bl_len = outcoming_bl.length(); - outcoming_bl.append(CEPH_MSGR_TAG_MSG); outcoming_bl.append((char*)&header, sizeof(header)); @@ -2213,12 +2211,9 @@ ssize_t AsyncConnection::write_message(Message *m, bufferlist& bl, bool more) if (rc < 0) { ldout(async_msgr->cct, 1) << __func__ << " error sending " << m << ", " << cpp_strerror(rc) << dendl; - } else if (rc == 0) { - logger->inc(l_msgr_send_bytes, total_send_size - original_bl_len); - ldout(async_msgr->cct, 10) << __func__ << " sending " << m << " done." << dendl; } else { logger->inc(l_msgr_send_bytes, total_send_size - outcoming_bl.length()); - ldout(async_msgr->cct, 10) << __func__ << " sending " << m << " continuely." << dendl; + ldout(async_msgr->cct, 10) << __func__ << " sending " << m << (rc ? " continuely." :" done.") << dendl; } if (m->get_type() == CEPH_MSG_OSD_OP) OID_EVENT_TRACE_WITH_MSG(m, "SEND_MSG_OSD_OP_END", false);