From: huanwen ren Date: Tue, 13 Jun 2017 09:16:22 +0000 (+0800) Subject: client: call the lru_remove() twice,when trim cache X-Git-Tag: v12.1.0~31^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=13445894dae0545aecf0d9dd9f0eede2b3a1aefe;p=ceph.git client: call the lru_remove() twice,when trim cache call the lru_remove() twice,when trim cache, first: trim_cache()---> lru_expire() ---> lru_remove(); second: trim_cache()---> trim_dentry() ---> unlink() ---> lru_remove(). fix as: In access to lru's dentry information, the first does not remove the operation, unified in the trim_dentry function to deal with more reasonable. Signed-off-by: huanwen ren --- diff --git a/src/client/Client.cc b/src/client/Client.cc index cbb216aa768..1a4037735d0 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -602,7 +602,7 @@ void Client::trim_cache(bool trim_kernel_dcache) if (lru.lru_get_size() <= lru.lru_get_max()) break; // trim! - Dentry *dn = static_cast(lru.lru_expire()); + Dentry *dn = static_cast(lru.lru_get_next_expire()); if (!dn) break; // done