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>
(cherry picked from commit
bd78bdca3d7d7659b7ec0f12b77a2002282fec13)
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();