Skip to content

Commit bd78bdc

Browse files
committed
cephfs_mirror: Fixes 'Bad file descriptor' showing during test_cephfs_mirror_cancel_mirroring_and_readd execution
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 <[email protected]>
1 parent 630f8e0 commit bd78bdc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/tools/cephfs_mirror/PeerReplayer.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,12 @@ int PeerReplayer::do_synchronize(const std::string &dir_root, const Snapshot &cu
12811281
break;
12821282
}
12831283

1284+
r = pre_sync_check_and_open_handles(dir_root, current, boost::none, &fh);
1285+
if (r < 0) {
1286+
dout(5) << ": cannot proceed with sync: " << cpp_strerror(r) << dendl;
1287+
return r;
1288+
}
1289+
12841290
dout(20) << ": " << sync_stack.size() << " entries in stack" << dendl;
12851291
std::string e_name;
12861292
auto &entry = sync_stack.top();

0 commit comments

Comments
 (0)