]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
cephfs-mirror: remove redundant ceph_close() calls. 60667/head
authorIgor Fedotov <igor.fedotov@croit.io>
Thu, 7 Nov 2024 16:00:27 +0000 (19:00 +0300)
committerIgor Fedotov <igor.fedotov@croit.io>
Tue, 3 Dec 2024 12:35:52 +0000 (15:35 +0300)
commit7a747bc55381b840d76202c9897f7a0ab8d143b3
treea1537a984a5447c0adf1af65b1cabff0f86b2b29
parent6f1d21c9ec432941f83d579d64b79b4252f3fc62
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>
src/tools/cephfs_mirror/PeerReplayer.cc
src/tools/cephfs_mirror/PeerReplayer.h