]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: prevent trim count from underflowing 18309/head
authorPatrick Donnelly <pdonnell@redhat.com>
Sat, 14 Oct 2017 20:47:53 +0000 (13:47 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Sat, 14 Oct 2017 20:47:53 +0000 (13:47 -0700)
Fixes: http://tracker.ceph.com/issues/21807
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/MDCache.cc

index 17e3c4323aa6cc33ae0357b5e1e6e8570a06dde5..17068a64ca2deb9c2033d97634feb950e0bd0f07 100644 (file)
@@ -6457,8 +6457,8 @@ void MDCache::trim_lru(uint64_t count, map<mds_rank_t, MCacheExpire*> &expiremap
       unexpirables.push_back(dn);
     } else {
       trimmed++;
+      if (count > 0) count--;
     }
-    count--;
   }
 
   for (auto &dn : unexpirables) {