Skip to content

mds: wrong snap check for directory with parent snaps - #63524

Merged
vshankar merged 4 commits into
ceph:mainfrom
batrick:i71462
Jul 25, 2025
Merged

vshankar merged 4 commits into
ceph:mainfrom
batrick:i71462

Conversation

@batrick

@batrick batrick commented May 27, 2025 •

Copy link
Copy Markdown
Member

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

@github-actions github-actions Bot added cephfs Ceph File System tests labels May 27, 2025
batrick added 4 commits May 27, 2025 10:51
If the parent directory has snapshots but the child was created after, then we
should be able to modify its charmap.

Signed-off-by: Patrick Donnelly <[email protected]>
Fixes: https://tracker.ceph.com/issues/71462
To look if the directory's first is beyond the last snap. This matches the behavior of lssnaps.

Signed-off-by: Patrick Donnelly <[email protected]>
Fixes: https://tracker.ceph.com/issues/71462
@batrick
batrick requested a review from a team June 3, 2025 12:33

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

LGTM

@rishabh-d-dave rishabh-d-dave 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.

Just some nits I had in mind when I reviewed this PR few days ago.

Comment thread src/mds/Server.cc
Comment on lines 9243 to +9244
SnapRealm *realm = diri->find_snaprealm();
return !realm->get_snaps().empty();
auto& snaps = realm->get_snaps();

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.

nit: since realm is not used anywhere else in this method -

Suggested change
SnapRealm *realm = diri->find_snaprealm();
return !realm->get_snaps().empty();
auto& snaps = realm->get_snaps();
auto& snaps = diri->find_snaprealm()->get_snaps();

Comment thread src/mds/Server.cc
Comment on lines +9245 to +9246
auto it = snaps.lower_bound(diri->get_oldest_snap());
return it != snaps.end();

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.

nit: I find following more succinct -

Suggested change
auto it = snaps.lower_bound(diri->get_oldest_snap());
return it != snaps.end();
return snaps.lower_bound(diri->get_oldest_snap()) != snaps.end();

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 succinct - readability is far more important than writing compact code which essentially does this same thing.

@vshankar

Copy link
Copy Markdown
Contributor

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

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.

3 participants