]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedBackend: cast variable to unsigned before comparing 40909/head
authorKefu Chai <kchai@redhat.com>
Mon, 19 Apr 2021 10:03:13 +0000 (18:03 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 19 Apr 2021 10:04:47 +0000 (18:04 +0800)
after the yaml-to-cxx migration, osd_deep_scrub_stride is an OPT_SIZE,
and is hence represented with an uint64. so we need to cast `r` to
uint64_t before comparing it with this setting for silencing GCC
warning.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/osd/ReplicatedBackend.cc

index 1aa3ba149b2c2cf9c4c08c6598a60b3dcd1221c4..669cdbce0208e0a1c511e33f6b4badbb9ad5966f 100644 (file)
@@ -671,7 +671,7 @@ int ReplicatedBackend::be_deep_scrub(
       pos.data_hash << bl;
     }
     pos.data_pos += r;
-    if (r == cct->_conf->osd_deep_scrub_stride) {
+    if (static_cast<uint64_t>(r) == cct->_conf->osd_deep_scrub_stride) {
       dout(20) << __func__ << "  " << poid << " more data, digest so far 0x"
               << std::hex << pos.data_hash.digest() << std::dec << dendl;
       return -EINPROGRESS;