]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: send dentry unlink message to replicas of stray dentry
authorYan, Zheng <zheng.z.yan@intel.com>
Sat, 26 Apr 2014 12:30:04 +0000 (20:30 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Tue, 6 May 2014 23:10:16 +0000 (07:10 +0800)
stray dentry may have more replicas than the unlinked dentry has.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/MDCache.cc

index cc2f2be3bbb94acfdd2a2f320869ee5909d6665b..57f0b92e7fcd249aff7d84f0cd9de55f655bedc3 100644 (file)
@@ -10445,8 +10445,12 @@ void MDCache::send_dentry_unlink(CDentry *dn, CDentry *straydn, MDRequestRef& md
 {
   dout(10) << "send_dentry_unlink " << *dn << dendl;
   // share unlink news with replicas
-  for (map<int,unsigned>::iterator it = dn->replicas_begin();
-       it != dn->replicas_end();
+  map<int,unsigned> replicas;
+  replicas.insert(dn->replicas_begin(), dn->replicas_end());
+  if (straydn)
+    replicas.insert(straydn->replicas_begin(), straydn->replicas_end());
+  for (map<int,unsigned>::iterator it = replicas.begin();
+       it != replicas.end();
        ++it) {
     // don't tell (rmdir) witnesses; they already know
     if (mdr.get() && mdr->more()->witnessed.count(it->first))