mds: fix MDCache::trim() with max == 0

MDCache::shutdown_pass call MDCache::trim with max == 0. If the last
dentry is non-null, MDCache::trim does nothing

Signed-off-by: Yan, Zheng <zyan@redhat.com>
This commit is contained in:
Yan, Zheng 2017-01-11 17:14:53 +08:00
parent 9b97554f0a
commit 2f50921492

View File

@ -6385,7 +6385,7 @@ bool MDCache::trim(int max, int count)
}
if (!dn->get_linkage()->is_null()) {
trimming_nulls = false;
if (lru.lru_get_size() + unexpirable <= (unsigned)max) {
if (lru.lru_get_size() + unexpirable < (unsigned)max) {
unexpirables.push_back(dn);
break;
}