New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mon/OSDMonitor: fix dividing by zero in OSDUtilizationDumper #13531

Merged
merged 1 commit into from Feb 27, 2017

Conversation

Projects
None yet
3 participants
@LiumxNL
Contributor

LiumxNL commented Feb 20, 2017

Signed-off-by: Mingxin Liu mingxin@xsky.com

@LiumxNL LiumxNL changed the title from osd/OSDMonitor: fix deviding by zero in OSDUtilizationDumper to mon/OSDMonitor: fix deviding by zero in OSDUtilizationDumper Feb 20, 2017

@@ -641,7 +641,10 @@ class OSDUtilizationDumper : public CrushTreeDumper::Dumper<F> {
int64_t kb = 0, kb_used = 0, kb_avail = 0;
double util = 0;
if (get_bucket_utilization(qi.id, &kb, &kb_used, &kb_avail))
if (kb_used) {
assert(kb > 0);

This comment has been minimized.

@tchaikov

tchaikov Feb 20, 2017

Contributor

this does not fix the divide by zero issue. if kb is 0, monitor crashes as before.

@tchaikov tchaikov added the mon label Feb 20, 2017

mon/OSDMonitor: fix deviding by zero in OSDUtilizationDumper
Signed-off-by: Mingxin Liu <mingxin@xsky.com>
@Daveweco

This comment has been minimized.

Daveweco commented Feb 21, 2017

LGTM

@LiumxNL

This comment has been minimized.

Contributor

LiumxNL commented Feb 21, 2017

@tchaikov updated

@tchaikov tchaikov self-assigned this Feb 21, 2017

@tchaikov tchaikov changed the title from mon/OSDMonitor: fix deviding by zero in OSDUtilizationDumper to mon/OSDMonitor: fix dividing by zero in OSDUtilizationDumper Feb 21, 2017

@tchaikov

This comment has been minimized.

@tchaikov tchaikov merged commit af5e1e8 into ceph:master Feb 27, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details

joke-lee added a commit to joke-lee/ceph that referenced this pull request Dec 19, 2017

mon/OSDMonitor: fix deviding by zero in OSDUtilizationDumper
ceph#13531

Change-Id: Ied57f5af644a584be1040f2f8007528df9a0f41c
Signed-off-by: Mingxin Liu <mingxin@xsky.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment