Skip to content

mds: use lower_bound() to scan waiting_locks - #71385

Merged
vshankar merged 1 commit into
ceph:mainfrom
MaxKellermann:mds_flock__lower_bound
Sep 9, 2026
Merged

vshankar merged 1 commit into
ceph:mainfrom
MaxKellermann:mds_flock__lower_bound

Conversation

@MaxKellermann

Copy link
Copy Markdown
Member

is_waiting() and remove_waiting() located the start of their scan with std::multimap::find(), which may return any element with the requested key, not the first. Entries sorting before the returned one are then never examined, so a waiting lock can be reported absent or left behind.

This currently works only because libstdc++'s find() just happens to return the first matching element, but the standard allows returning any matching element.

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.

@github-actions github-actions Bot added the cephfs Ceph File System label Aug 27, 2026
@MaxKellermann
MaxKellermann requested a review from batrick August 27, 2026 12:31
@MaxKellermann

Copy link
Copy Markdown
Member Author

jenkins test api

@vshankar

vshankar commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

This fix is a backport candidate. Please create one and link it in the commit message.

@vshankar

vshankar commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by vshankar started 2026-09-02-13:52.

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

is_waiting() and remove_waiting() located the start of their scan with
std::multimap::find(), which may return any element with the requested
key, not the first.  Entries sorting before the returned one are then
never examined, so a waiting lock can be reported absent or left
behind.

This currently works only because libstdc++'s find() just happens to
return the first matching element, but the standard allows returning
any matching element.

Fixes: https://tracker.ceph.com/issues/80398
Signed-off-by: Max Kellermann <[email protected]>
@vshankar
vshankar force-pushed the mds_flock__lower_bound branch from cb7c2ab to 83eba01 Compare September 9, 2026 04:35
@vshankar

vshankar commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

(updated commit with tracker link)

@vshankar
vshankar merged commit 50c281c into ceph:main Sep 9, 2026
14 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants