]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: call the lru_remove() twice,when trim cache 15662/head
authorhuanwen ren <rhwlyw@163.com>
Tue, 13 Jun 2017 09:16:22 +0000 (17:16 +0800)
committerGitHub <noreply@github.com>
Tue, 13 Jun 2017 09:16:22 +0000 (17:16 +0800)
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 <ren.huanwen@zte.com.cn>
src/client/Client.cc

index cbb216aa76822c2540782295ef1913dd9149786a..1a4037735d0bf176c394d169c0ae61251b5925ff 100644 (file)
@@ -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<Dentry*>(lru.lru_expire());
+    Dentry *dn = static_cast<Dentry*>(lru.lru_get_next_expire());
     if (!dn)
       break;  // done