Skip to content

rgw/dedup: encode urgent_msg_t explicitly as its underlying type - #72834

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

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

Conversation

@MaxKellermann

Copy link
Copy Markdown
Member

urgent_msg_t is an unscoped enum without an encoder; it was implicitly promoted to int and encoded with the legacy encode(int32_t) overload. Use std::to_underlying() instead, so the wire format does not depend on implicit conversions. The underlying type is unsigned int, which is encoded as the same 4 little-endian bytes (the receiver in Background::handle_notify() decodes an int32_t).

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.

urgent_msg_t is an unscoped enum without an encoder; it was implicitly
promoted to int and encoded with the legacy encode(int32_t) overload.
Use std::to_underlying() instead, so the wire format does not depend
on implicit conversions.  The underlying type is `unsigned int`,
which is encoded as the same 4 little-endian bytes (the receiver in
Background::handle_notify() decodes an int32_t).

Signed-off-by: Max Kellermann <[email protected]>
@MaxKellermann
MaxKellermann requested a review from a team as a code owner October 19, 2026 12:47
@github-actions github-actions Bot added the rgw label Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant