From 763e26c41e0a56ea12f9bc39b5821cdb48d8cdbf Mon Sep 17 00:00:00 2001 From: John Spray Date: Mon, 16 Feb 2015 17:03:42 +0000 Subject: [PATCH] mds: eval stray on remove dentry replica 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 --- src/mds/MDCache.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 85e0634d11364..4898af301d649 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -7097,6 +7097,12 @@ void MDCache::dentry_remove_replica(CDentry *dn, mds_rank_t from, setlock.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() -- 2.39.5