this helps stray reintegration in workload that first creates new
hardlink, then removes old hardlink
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
dout(10) << "_link_local_finish " << *dn << " to " << *targeti << dendl;
// link and unlock the NEW dentry
- dn->pop_projected_linkage();
+ CDentry::linkage_t *dnl = dn->pop_projected_linkage();
+ if (!dnl->get_inode())
+ dn->link_remote(dnl, targeti);
dn->mark_dirty(dnpv, mdr->ls);
// target inode
if (inc) {
// link the new dentry
- dn->pop_projected_linkage();
+ CDentry::linkage_t *dnl = dn->pop_projected_linkage();
+ if (!dnl->get_inode())
+ dn->link_remote(dnl, targeti);
dn->mark_dirty(dpv, mdr->ls);
} else {
// unlink main dentry