diff mbox

[17/29] mds: call maybe_eval_stray after removing a replica dentry

Message ID 1357290140-17044-18-git-send-email-zheng.z.yan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yan, Zheng Jan. 4, 2013, 9:02 a.m. UTC
From: "Yan, Zheng" <zheng.z.yan@intel.com>

MDCache::handle_cache_expire() processes dentries after inodes, so the
MDCache::maybe_eval_stray() in MDCache::inode_remove_replica() always
fails to remove stray inode because MDCache::eval_stray() checks if the
stray inode's dentry is replicated.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
 src/mds/MDCache.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc
index 3410b0f..5adf4b7 100644
--- a/src/mds/MDCache.cc
+++ b/src/mds/MDCache.cc
@@ -6120,9 +6120,11 @@  void MDCache::dentry_remove_replica(CDentry *dn, int from)
   // fix lock
   if (dn->lock.remove_replica(from))
     mds->locker->eval_gather(&dn->lock);
-}
-
 
+  CDentry::linkage_t *dnl = dn->get_projected_linkage();
+  if (dnl->is_primary())
+    maybe_eval_stray(dnl->get_inode());
+}
 
 void MDCache::trim_client_leases()
 {