From: Patrick Donnelly Date: Sat, 14 Oct 2017 20:47:53 +0000 (-0700) Subject: mds: prevent trim count from underflowing X-Git-Tag: v13.0.1~562^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F18309%2Fhead;p=ceph.git mds: prevent trim count from underflowing Fixes: http://tracker.ceph.com/issues/21807 Signed-off-by: Patrick Donnelly --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 17e3c4323aa6..17068a64ca2d 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -6457,8 +6457,8 @@ void MDCache::trim_lru(uint64_t count, map &expiremap unexpirables.push_back(dn); } else { trimmed++; + if (count > 0) count--; } - count--; } for (auto &dn : unexpirables) {