]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: eval stray on remove dentry replica
authorJohn Spray <john.spray@redhat.com>
Mon, 16 Feb 2015 17:03:42 +0000 (17:03 +0000)
committerJohn Spray <john.spray@redhat.com>
Fri, 20 Mar 2015 12:32:47 +0000 (12:32 +0000)
This happens because when handling an MCacheExpire,
we expire inodes first and then dentries, so when
the inodes are put() their dentries still are replicated
so eval_stray fails.  Do an explicit call to maybe_eval_stray
when handling the expire for the dentry in order to catch
this.

One hits this path when migrating a stray away from
a stopping MDS rank.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/MDCache.cc

index 85e0634d113647cdf28723d2173dd7c78c4736f8..4898af301d6499cf3682432224cf08865c4c9a75 100644 (file)
@@ -7097,6 +7097,12 @@ void MDCache::dentry_remove_replica(CDentry *dn, mds_rank_t from, set<SimpleLock
   // fix lock
   if (dn->lock.remove_replica(from))
     gather_locks.insert(&dn->lock);
+
+  // Replicated strays might now be elegible for purge
+  CDentry::linkage_t *dnl = dn->get_linkage();
+  if (dnl->is_primary()) {
+    maybe_eval_stray(dnl->get_inode());
+  }
 }
 
 void MDCache::trim_client_leases()