Skip to content

crimson/os/seastore: fix laddr_t formatter and its use - #69476

Merged
tchaikov merged 1 commit into
ceph:mainfrom
ronen-fr:wip-rf-fmtxx-crimson
Jun 17, 2026
Merged

tchaikov merged 1 commit into
ceph:mainfrom
ronen-fr:wip-rf-fmtxx-crimson

Conversation

@ronen-fr

Copy link
Copy Markdown
Contributor

'laddr_t' existing formatter did not support a ':x' format specifier (actually - the output was always hexadecomal).
Here we remove the ':x', but also refactor the custom formatter to avoid using the streambuf mechanism.
Note - SEASTORE_LADDR_USE_BOOST_U128 is no longer supported by the formatter.

Fixes: https://tracker.ceph.com/issues/77399

@ronen-fr
ronen-fr requested a review from a team as a code owner June 15, 2026 11:26
@@ -3652,6 +3652,42 @@ template <> struct fmt::formatter<crimson::os::seastore::omap_type_t> : fmt::ost
template <> struct fmt::formatter<ceph::buffer::list> : fmt::ostream_formatter {};
#endif

namespace fmt {
template <>
struct fmt::formatter<crimson::os::seastore::laddr_t> {

@tchaikov tchaikov Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is not quite right. we either add formatter<crimson::os::seastore::laddr_t> in the fmt namespace, like:

namespace fmt {
template <> struct formatter<X> {
  /// ...
};

or just define it with the qualified-id in the global scope, like:

template <> struct fmt::formatter<X> {
  /// ...
};

but we should not do both. clang might accept it with -Wextra-qualification. but GCC should reject it extra qualification not allowed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Of course. Thank you. Skipped that when I was adding the 'namespace'

@@ -1442,7 +1442,7 @@ ObjectDataHandler::clear_ret ObjectDataHandler::trim_data_reservation(
context_t ctx, object_data_t &object_data, extent_len_t size)
{
LOG_PREFIX(ObjectDataHandler::trim_data_reservation);
DEBUGT("0x{:x}~0x{:x}, 0x{:x}",
DEBUGT("0x{:x}~0x{}, 0x{:x}",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

so, in this change, we added a specialization for crimson::os::seastore::laddr_t, which is the return value's type of object_data.get_reserved_data_base(), so we should change the above line to

DEBUGT("{}~0x{:x}, 0x{:x}",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes - I've miscounted the arguments

'laddr_t' existing formatter did not support a ':x' format specifier
(actually - the output was always hexadecomal).
Here we remove the ':x', but also refactor the custom formatter to
avoid using the streambuf mechanism.
Note - SEASTORE_LADDR_USE_BOOST_U128 is no longer supported by the formatter.

Fixes: https://tracker.ceph.com/issues/77399
Signed-off-by: Ronen Friedman <[email protected]>
@ronen-fr
ronen-fr force-pushed the wip-rf-fmtxx-crimson branch from 1147d68 to 620d936 Compare June 16, 2026 15:13
@ronen-fr
ronen-fr requested a review from tchaikov June 16, 2026 15:14
@tchaikov

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

1 similar comment
@tchaikov

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@Matan-B Matan-B added this to Crimson Jun 17, 2026
@Matan-B Matan-B moved this to Awaits review in Crimson Jun 17, 2026

@tchaikov tchaikov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@tchaikov
tchaikov merged commit 19d5e52 into ceph:main Jun 17, 2026
6 checks passed
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I have resolved the following tracker ticket due to the merge of this PR:

No backports are pending for the ticket. If this is incorrect, please update the tracker
ticket and reset to Pending Backport state.

Update Log: https://github.com/ceph/ceph/actions/runs/27677324803

@ronen-fr ronen-fr moved this from Awaits review to Merged (Main) in Crimson Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Merged (Main)

Development

Successfully merging this pull request may close these issues.

2 participants