Skip to content

mds: tolerate stale version in CDir::mark_dirty - #70904

Merged
vshankar merged 1 commit into
ceph:mainfrom
xiubli:fix-dirty
Sep 1, 2026
Merged

vshankar merged 1 commit into
ceph:mainfrom
xiubli:fix-dirty

Conversation

@xiubli

@xiubli xiubli commented Aug 7, 2026 •

Copy link
Copy Markdown
Member

When multiple mutations project the same directory concurrently, their journal commits can complete out of order. A later projection may already have advanced get_version() past the pv of an earlier one via pop_and_dirty_projected_fnode(). When the earlier mutation eventually applies, CDir::mark_dirty() is called with a pv that is no longer greater than get_version(), triggering the assertion.

This is harmless: the dir is already dirty at a newer version, and the dentry/inode versions are already properly set by their own mark_dirty() calls before reaching here. Replace the assertion with a graceful early return.

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

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.

When multiple mutations project the same directory concurrently,
their journal commits can complete out of order.  A later
projection may already have advanced get_version() past the pv
of an earlier one via pop_and_dirty_projected_fnode().  When
the earlier mutation eventually applies, CDir::mark_dirty() is
called with a pv that is no longer greater than get_version(),
triggering the assertion.

This is harmless: the dir is already dirty at a newer version,
and the dentry/inode versions are already properly set by their
own mark_dirty() calls before reaching here.  Replace the
assertion with a graceful early return.

Fixes: https://tracker.ceph.com/issues/79136
Signed-off-by: Xiubo Li <[email protected]>
@github-actions github-actions Bot added the cephfs Ceph File System label Aug 7, 2026
@xiubli
xiubli requested a review from a team August 7, 2026 05:40

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

Good catch!

Comment thread src/mds/CDir.cc
// the pv of an earlier one. This is harmless: the dir is
// already dirty at a newer version, and the dentry/inode
// versions are already set by their own mark_dirty before
// reaching here. Skip the stale version mark.

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.

(extreme nit-picking alert) double spaces here but nice catch!

@vshankar

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by vshankar started 2026-08-13-12:44.

@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 merged commit 49f7eaa into ceph:main Sep 1, 2026
12 of 17 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