From: Kefu Chai Date: Wed, 6 Oct 2021 22:38:13 +0000 (+0800) Subject: msg/async/ProtocolV2: cast usec to double when converting from nsec X-Git-Tag: v17.1.0~728^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8af0d76ca35fbc1d0ac13cd56180256019ff26c3;p=ceph-ci.git msg/async/ProtocolV2: cast usec to double when converting from nsec to be consistent with the same logic in V1, and more importantly, it is more correct. the change was suggested by Ilya Dryomov . Signed-off-by: Kefu Chai --- diff --git a/src/msg/async/ProtocolV2.cc b/src/msg/async/ProtocolV2.cc index 817bc347acb..d13f0ead3ac 100644 --- a/src/msg/async/ProtocolV2.cc +++ b/src/msg/async/ProtocolV2.cc @@ -1437,7 +1437,7 @@ CtPtr ProtocolV2::handle_message() { message->get_type() == CEPH_MSG_OSD_OPREPLY) { utime_t ltt_processed_stamp = ceph_clock_now(); double usecs_elapsed = - (ltt_processed_stamp.to_nsec() - recv_stamp.to_nsec()) / 1000; + ((double)(ltt_processed_stamp.to_nsec() - recv_stamp.to_nsec())) / 1000; ostringstream buf; if (message->get_type() == CEPH_MSG_OSD_OP) OID_ELAPSED_WITH_MSG(message, usecs_elapsed, "TIME_TO_DECODE_OSD_OP",