]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix a signed/unsigned warning in PG 13922/head
authorGreg Farnum <gfarnum@redhat.com>
Fri, 10 Mar 2017 22:42:41 +0000 (14:42 -0800)
committerGreg Farnum <gfarnum@redhat.com>
Fri, 10 Mar 2017 22:46:06 +0000 (14:46 -0800)
It would be nice if the stats were unsigned, since they can't go negative,
but that's not the world we live in.
(Also, we probably use these structures as deltas which *do*
need to go negative? I didn't check.)

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/osd/PG.cc

index 3a75d8932e92829d7c28ef3dbbf4dcbe3e9e164b..e6994c284f70cf31346338389856b60004734680 100644 (file)
@@ -2584,7 +2584,7 @@ void PG::_update_calc_stats()
   if ((is_degraded() || is_undersized() || !is_clean()) && is_peered()) {
     // NOTE: we only generate copies, degraded, misplaced and unfound
     // values for the summation, not individual stat categories.
-    uint64_t num_objects = info.stats.stats.sum.num_objects;
+    int64_t num_objects = info.stats.stats.sum.num_objects;
 
     // Total sum of all missing
     int64_t missing = 0;