From: David Zafman Date: Wed, 12 Apr 2017 05:04:07 +0000 (-0700) Subject: osd: check_full_status() remove bogus comment and use equivalent computation X-Git-Tag: v12.0.2~51^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1fafec217599b65d902e21efd43049646e1e145c;p=ceph.git osd: check_full_status() remove bogus comment and use equivalent computation We actually compute kb_used as the kb - kb_avail. We don't have the statfs() system call issue of non-privileged f_bavail vs f_bfree. It was assumed that used was really like (blocks - f_bfree). It is not. Signed-off-by: David Zafman --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index e39330e09237..c8031826f4e6 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -716,13 +716,7 @@ void OSDService::check_full_status(const osd_stat_t &osd_stat) { Mutex::Locker l(full_status_lock); - // We base ratio on kb_avail rather than kb_used because they can - // differ significantly e.g. on btrfs volumes with a large number of - // chunks reserved for metadata, and for our purposes (avoiding - // completely filling the disk) it's far more important to know how - // much space is available to use than how much we've already used. - float ratio = ((float)(osd_stat.kb - osd_stat.kb_avail)) / - ((float)osd_stat.kb); + float ratio = ((float)osd_stat.kb_used) / ((float)osd_stat.kb); cur_ratio = ratio; // The OSDMap ratios take precendence. So if the failsafe is .95 and