From ae4dda412f7f3c316fa3718f72ab1c023d0a271c Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Tue, 14 Dec 2010 16:44:55 -0800 Subject: [PATCH] mdcache: adjust trim() to handle running during standby-replay. This just means it needs to handle files on the open list and not trim them. Add a check for that with an assert, and keep them alive. Signed-off-by: Greg Farnum --- src/mds/MDCache.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index e0adca65d59ca..6ac26d51b26cb 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -4974,6 +4974,12 @@ bool MDCache::trim(int max) while (lru.lru_get_size() > (unsigned)max) { CDentry *dn = (CDentry*)lru.lru_expire(); if (!dn) break; + if (dn->get_linkage() && + dn->get_linkage()->inode->item_open_file.is_on_list()) { + assert(mds->is_standby_replay()); + lru.lru_insert_mid(dn); + continue; + } trim_dentry(dn, expiremap); } -- 2.39.5