Skip to content
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

os/bluestore: fix empty store divide by 0 runtime error #46133

Closed
wants to merge 1 commit into from

Conversation

athanatos
Copy link
Contributor

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

Fixes runtime error
../src/os/bluestore/BlueStore.cc:4364:7: runtime error: inf is outside the range of representable values of type 'unsigned long'

Fixes: https://tracker.ceph.com/issues/55325
Signed-off-by: Samuel Just <sjust@redhat.com>
@tchaikov
Copy link
Contributor

tchaikov commented May 4, 2022

jenkins test make check

@athanatos
Copy link
Contributor Author

@aclamk Does this look ok?

@djgalloway djgalloway changed the base branch from master to main May 25, 2022 20:00
@@ -2460,7 +2460,8 @@ class BlueStore : public ObjectStore,
return (2 > onode_num) ? 2 : onode_num;
}
double get_bytes_per_onode() const {
return (double)_get_used_bytes() / (double)_get_num_onodes();
return std::max((double)_get_used_bytes(), 1.0) /
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like std::max should be applied to _get_num_onodes() call not _get_used_bytes() to fight devision by zero issue

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label Feb 28, 2023
@github-actions
Copy link

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions bot closed this Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants