Skip to content

include/health: fix parameter type of denc_traits<health_status_t>::b… - #72836

Open
MaxKellermann wants to merge 1 commit into
ceph:mainfrom
MaxKellermann:health__bound_encode_type
Open

MaxKellermann wants to merge 1 commit into
ceph:mainfrom
MaxKellermann:health__bound_encode_type

Conversation

@MaxKellermann

Copy link
Copy Markdown
Member

…ound_encode()

The parameter was const ceph::buffer::ptr& instead of const health_status_t&. This only compiled because the enum was implicitly converted to unsigned and then to a buffer::ptr via its implicit ptr(unsigned) constructor, allocating a temporary buffer of 0..2 bytes on every bound_encode() call.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

…ound_encode()

The parameter was `const ceph::buffer::ptr&` instead of
`const health_status_t&`.  This only compiled because the enum was
implicitly converted to `unsigned` and then to a buffer::ptr via its
implicit `ptr(unsigned)` constructor, allocating a temporary buffer
of 0..2 bytes on every bound_encode() call.

Signed-off-by: Max Kellermann <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant