]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
cephfs-mirror: remove redundant ceph_close() calls.
authorIgor Fedotov <igor.fedotov@croit.io>
Thu, 7 Nov 2024 16:00:27 +0000 (19:00 +0300)
committerIgor Fedotov <igor.fedotov@croit.io>
Mon, 16 Dec 2024 12:51:41 +0000 (15:51 +0300)
commitc4ce3c06617a2ee12f80a5c2bce6dc2942f62491
tree1e2d10997221d5c33cd5b99d86c0afab946fbd90
parent442e64586612e463a310d1b2ab6f60c108455d48
cephfs-mirror: remove redundant ceph_close() calls.

https://github.com/ceph/ceph/pull/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
https://github.com/ceph/ceph/pull/56118/commits/bd78bdca3d7d7659b7ec0f12b77a2002282fec13
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 7a747bc55381b840d76202c9897f7a0ab8d143b3)
src/tools/cephfs_mirror/PeerReplayer.cc
src/tools/cephfs_mirror/PeerReplayer.h