Skip to content

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

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

mds: wrong snap check for directory with parent snaps#63524
vshankar merged 4 commits intoceph:mainfrom
batrick:i71462

Conversation

@batrick
Copy link
Member

@batrick batrick commented May 27, 2025

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
This test is checking for failure conditions.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
Fixes: https://tracker.ceph.com/issues/71462
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
Fixes: https://tracker.ceph.com/issues/71462
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 <pdonnell@ibm.com>
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 <pdonnell@ibm.com>
Fixes: https://tracker.ceph.com/issues/71462
@batrick batrick requested a review from a team June 3, 2025 12:33
Copy link
Contributor

@vshankar vshankar left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@rishabh-d-dave rishabh-d-dave left a comment

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 on lines 9243 to +9244
SnapRealm *realm = diri->find_snaprealm();
return !realm->get_snaps().empty();
auto& snaps = realm->get_snaps();
Copy link
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 on lines +9245 to +9246
auto it = snaps.lower_bound(diri->get_oldest_snap());
return it != snaps.end();
Copy link
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
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
Contributor

This PR is under test in https://tracker.ceph.com/issues/72210.

Copy link
Contributor

@vshankar vshankar left a comment

Choose a reason for hiding this comment

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

@vshankar vshankar merged commit 4591e72 into ceph:main Jul 25, 2025
12 checks passed
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