]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: compute OSD's space usage ratio via raw space utilization 41112/head
authorIgor Fedotov <ifed@suse.com>
Tue, 27 Apr 2021 10:38:31 +0000 (13:38 +0300)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Sat, 1 May 2021 06:02:33 +0000 (13:02 +0700)
Fixes: https://tracker.ceph.com/issues/50533
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
(cherry picked from commit 81c4d82be02ee14aff2849b3025a5dea6cb0327e)

src/osd/OSD.cc

index c95765e62c273cc174b47a4b4abea2911841ffcc..8ae62212e35999bcb31dec4a257abaa71e0b0cf2 100644 (file)
@@ -994,7 +994,7 @@ float OSDService::compute_adjusted_ratio(osd_stat_t new_stat, float *pratio,
                                         uint64_t adjust_used)
 {
   *pratio =
-   ((float)new_stat.statfs.get_used()) / ((float)new_stat.statfs.total);
+   ((float)new_stat.statfs.get_used_raw()) / ((float)new_stat.statfs.total);
 
   if (adjust_used) {
     dout(20) << __func__ << " Before kb_used() " << new_stat.statfs.kb_used()  << dendl;
@@ -1015,7 +1015,7 @@ float OSDService::compute_adjusted_ratio(osd_stat_t new_stat, float *pratio,
   if (backfill_adjusted) {
     dout(20) << __func__ << " backfill adjusted " << new_stat << dendl;
   }
-  return ((float)new_stat.statfs.get_used()) / ((float)new_stat.statfs.total);
+  return ((float)new_stat.statfs.get_used_raw()) / ((float)new_stat.statfs.total);
 }
 
 void OSDService::send_message_osd_cluster(int peer, Message *m, epoch_t from_epoch)