]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrubber: fix signed comparison warning 54799/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 5 Dec 2023 21:12:56 +0000 (16:12 -0500)
committerCasey Bodley <cbodley@redhat.com>
Tue, 5 Dec 2023 21:12:59 +0000 (16:12 -0500)
[681/1140] Building CXX object src/osd/CMakeFiles/osd.dir/scrubber/scrub_resources.cc.o
src/osd/scrubber/scrub_resources.cc: In member function ‘bool Scrub::ScrubResources::inc_scrubs_remote(pg_t)’:
src/osd/scrubber/scrub_resources.cc:84:18: warning: comparison of integer expressions of different signedness: ‘long unsigned int’ and ‘const int64_t’ {aka ‘const long int’} [-Wsign-compare]
   84 |   if (pre_op_cnt < conf->osd_max_scrubs) {
      |       ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/osd/scrubber/scrub_resources.cc

index 6203a2912aa9acb6a23cf601ad02620b6758f48b..dd9d31a157320a59508e2868513c2facd8d45864 100644 (file)
@@ -81,7 +81,7 @@ bool ScrubResources::inc_scrubs_remote(pg_t pgid)
   }
 
   auto pre_op_cnt = granted_reservations.size();
-  if (pre_op_cnt < conf->osd_max_scrubs) {
+  if (std::cmp_less(pre_op_cnt, conf->osd_max_scrubs)) {
     granted_reservations.insert(pgid);
     log_upwards(fmt::format(
        "{}: pg[{}] reserved. Remote scrubs count changed from {} -> {} (max "