Skip to content

mds: fix crash in MDCache::trim_lru() using wrong perf counter logger - #69831

Merged
vshankar merged 1 commit into
ceph:mainfrom
xiubli:fix_crash
Aug 5, 2026
Merged

vshankar merged 1 commit into
ceph:mainfrom
xiubli:fix_crash

Conversation

@xiubli

@xiubli xiubli commented Jun 30, 2026 •

Copy link
Copy Markdown
Member

MDCache::trim_lru() passes l_mdss_cache_trim_throttle (defined in Server.h's perf counter enum, base l_mdss_first=1000) to MDCache::logger (registered with l_mdc_first=3000). The index is out of range for the logger, triggering:

ceph_assert(idx > m_lower_bound) // 1124 > 3000 is false

Fix by using mds->server->logger where the counter is actually registered, and add friend class MDCache to Server for logger access.

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

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

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.

@xiubli
xiubli requested a review from a team June 30, 2026 10:21
@github-actions github-actions Bot added the cephfs Ceph File System label Jun 30, 2026
@xiubli

xiubli commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

jenkins test api

batrick
batrick previously requested changes Jul 7, 2026
Comment thread src/mds/MDCache.cc Resolved
@xiubli
xiubli requested a review from batrick July 9, 2026 00:43
@vshankar

vshankar commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

jenkins retest this please

Comment thread src/mds/MDCache.cc Resolved
@vshankar

Copy link
Copy Markdown
Contributor

@xiubli - please fix commit message (add signed off by tag).

The l_mdss_cache_trim_throttle counter was being accessed from
MDCache::trim_lru() via mds->server->logger, which required a null-pointer
guard and a friend declaration. Since this counter tracks cache trim
throttling, it logically belongs in the MDCache perf counter group.
Move it there and access it via MDCache's own logger directly.

Signed-off-by: Xiubo Li <[email protected]>
@xiubli

xiubli commented Jul 15, 2026

Copy link
Copy Markdown
Member Author

@xiubli - please fix commit message (add signed off by tag).

Done. Thanks

@vshankar

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by vshankar started 2026-07-21-10:48.

@vshankar vshankar 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.

@vshankar
vshankar dismissed batrick’s stale review August 5, 2026 05:42

Comment addressed.

@vshankar
vshankar merged commit bb2afd0 into ceph:main Aug 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cephfs Ceph File System needs-qa

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants