From 8af0d76ca35fbc1d0ac13cd56180256019ff26c3 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 7 Oct 2021 06:38:13 +0800 Subject: [PATCH] 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 --- src/msg/async/ProtocolV2.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", -- 2.39.5