From: Yan, Zheng Date: Wed, 11 Jan 2017 09:14:53 +0000 (+0800) Subject: mds: fix MDCache::trim() with max == 0 X-Git-Tag: v12.0.0~220^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F12794%2Fhead;p=ceph.git 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 --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 8d0d3a005bc9..e9bf26df2d45 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -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; }