]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async/ProtocolV2: cast usec to double when converting from nsec 43443/head
authorKefu Chai <tchaikov@gmail.com>
Wed, 6 Oct 2021 22:38:13 +0000 (06:38 +0800)
committerKefu Chai <tchaikov@gmail.com>
Thu, 7 Oct 2021 13:55:06 +0000 (21:55 +0800)
to be consistent with the same logic in V1, and more importantly, it is
more correct.

the change was suggested by Ilya Dryomov <idryomov@redhat.com>.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/msg/async/ProtocolV2.cc

index 817bc347acb2bcef46420bc3443f040f0d38a77b..d13f0ead3aced0fd8fc7b5901744871bbcf9d015 100644 (file)
@@ -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",