]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: link inode to newly created remote dentry
authorYan, Zheng <zyan@redhat.com>
Wed, 7 Jun 2017 10:21:39 +0000 (18:21 +0800)
committerYan, Zheng <zyan@redhat.com>
Wed, 7 Jun 2017 10:22:22 +0000 (18:22 +0800)
this helps stray reintegration in workload that first creates new
hardlink, then removes old hardlink

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/mds/Server.cc

index 43ea584be1b1d760f7e4032a0ab491070ce076d4..05791ede7247444d666a77a6b46576769ef2699e 100644 (file)
@@ -5320,7 +5320,9 @@ void Server::_link_local_finish(MDRequestRef& mdr, CDentry *dn, CInode *targeti,
   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
@@ -5438,7 +5440,9 @@ void Server::_link_remote_finish(MDRequestRef& mdr, bool inc,
 
   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