]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs_mirror: Fixes 'Bad file descriptor' showing during test_cephfs_mirror_cancel_m...
authorJos Collin <jcollin@redhat.com>
Mon, 25 Mar 2024 12:25:34 +0000 (17:55 +0530)
committerJos Collin <jcollin@redhat.com>
Tue, 20 Aug 2024 07:50:07 +0000 (13:20 +0530)
Avoid stale fh by calling pre_sync_check_and_open_handles inside the loop

Fixes: https://tracker.ceph.com/issues/65115
Signed-off-by: Jos Collin <jcollin@redhat.com>
src/tools/cephfs_mirror/PeerReplayer.cc

index ce35b72ed0e9bd08e33ea76e66df53957373ac0c..ffb2bfbd9404932a8590743c258648aa3b0892bf 100644 (file)
@@ -1281,6 +1281,12 @@ int PeerReplayer::do_synchronize(const std::string &dir_root, const Snapshot &cu
       break;
     }
 
+    r = pre_sync_check_and_open_handles(dir_root, current, boost::none, &fh);
+    if (r < 0) {
+      dout(5) << ": cannot proceed with sync: " << cpp_strerror(r) << dendl;
+      return r;
+    }
+
     dout(20) << ": " << sync_stack.size() << " entries in stack" << dendl;
     std::string e_name;
     auto &entry = sync_stack.top();