From: Kefu Chai Date: Mon, 19 Apr 2021 10:03:13 +0000 (+0800) Subject: osd/ReplicatedBackend: cast variable to unsigned before comparing X-Git-Tag: v17.1.0~2173^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F40909%2Fhead;p=ceph.git osd/ReplicatedBackend: cast variable to unsigned before comparing 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 --- diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index 1aa3ba149b2c..669cdbce0208 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -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(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;