Skip to content

squid: tools/cephfs-mirror: eliminate redundant ceph_close() call#61100

Merged
mchangir merged 2 commits intoceph:squidfrom
ifed01:wip-ifed-fix-cephfs-mirror-squ
Feb 6, 2025
Merged

squid: tools/cephfs-mirror: eliminate redundant ceph_close() call#61100
mchangir merged 2 commits intoceph:squidfrom
ifed01:wip-ifed-fix-cephfs-mirror-squ

Conversation

@ifed01
Copy link
Contributor

@ifed01 ifed01 commented Dec 16, 2024

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

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
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

Likely ceph#55619 missed that.

Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
(cherry picked from commit 6f1d21c)
ceph#55619 eliminates the need for ceph_close() call after successful ceph_fdopendir() one.
And introduces automatic file descriptor's close when corresponding ceph_closedir() is called.
That hasty ceph_close() call makes file descriptor
available for a new allocation which might conflict with the automatic fd close in the above ceph_closedir().

Full PeerReplayer::do_synchronize() has been reworked to close fds
properly, depending on whether ceph_fdopendir() has been already applied
to them.

Additionally for the sake of uniformity this reworks incremental do_synchronize()
in a way to do final fd closings similar to full implementation.

Plus this effectively reverts
ceph@bd78bdc
as it looks like a wrong approach to fight broken file descriptor
references. No much sense in reopening of the current snapshot's root folder
on each new entry processing. Instead this patch just doesn't close it from the
beginning.

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

Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
(cherry picked from commit 7a747bc)
@ifed01 ifed01 requested a review from joscollin December 16, 2024 12:54
@github-actions github-actions bot added the cephfs Ceph File System label Dec 16, 2024
@github-actions github-actions bot added this to the squid milestone Dec 16, 2024
@vshankar
Copy link
Contributor

vshankar commented Jan 5, 2025

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

Copy link
Contributor

@mchangir mchangir left a comment

Choose a reason for hiding this comment

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

@mchangir mchangir merged commit 1e3b72e into ceph:squid Feb 6, 2025
@ifed01 ifed01 deleted the wip-ifed-fix-cephfs-mirror-squ branch February 7, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants